Skip to content

Commit abd685d

Browse files
committed
workflow: improve the benchmark scripts
1 parent 7b3c176 commit abd685d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

benchmark/index.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ async function buildApp(isVapor) {
177177

178178
function startServer() {
179179
const server = connect().use(sirv('./client/dist')).listen(port)
180-
console.info(`\n\nServer started at`, colors.blue(`http://localhost:${port}`))
180+
printPort(port)
181181
process.on('SIGTERM', () => server.close())
182182
return server
183183
}
@@ -338,3 +338,14 @@ function compute(array) {
338338
function round(n) {
339339
return +n.toFixed(2)
340340
}
341+
342+
/** @param {number} port */
343+
function printPort(port) {
344+
const vaporLink = !noVapor
345+
? `\nVapor: ${colors.blue(`http://localhost:${port}/vapor`)}`
346+
: ''
347+
const vdomLink = vdom
348+
? `\nvDom: ${colors.blue(`http://localhost:${port}/vdom`)}`
349+
: ''
350+
console.info(`\n\nServer started at`, vaporLink, vdomLink)
351+
}

benchmark/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "MIT",
66
"type": "module",
77
"scripts": {
8+
"dev": "pnpm start --noHeadless --skipBench --vdom",
89
"start": "node index.js"
910
},
1011
"dependencies": {

0 commit comments

Comments
 (0)