Fix NodeJS benchmark

Former-commit-id: a1d87cf3a3f4790b9e392dc3c100180284286797
This commit is contained in:
Quentin Homareau 2017-11-19 13:02:48 +01:00
parent f4b4742eca
commit d1cc5599b6
2 changed files with 21 additions and 11 deletions

View File

@ -1,14 +1,23 @@
process.env.NODE_ENV = 'production'; process.env.NODE_ENV = 'production';
const express = require('express'); const express = require('express');
const app = express(); const createWorker = require('throng')
app.get('/api/values/:id', function (req, res) {
res.send('value');
});
app.listen(5000, function () { createWorker(createWebServer)
console.log(
'Now listening on: http://localhost:5000\nApplication started. Press CTRL+C to shut down.' function createWebServer()
) {
}); const app = express();
app.get('/api/values/:id', function (req, res) {
res.send('value');
});
app.listen(5000, function () {
console.log(
'Now listening on: http://localhost:5000\nApplication started. Press CTRL+C to shut down.'
)
});
}

View File

@ -9,6 +9,7 @@
"author": "Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>", "author": "Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"express": "^4.16.0" "express": "^4.16.0",
"throng": "4.0.0"
} }
} }