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,6 +1,13 @@
process.env.NODE_ENV = 'production'; process.env.NODE_ENV = 'production';
const express = require('express'); const express = require('express');
const createWorker = require('throng')
createWorker(createWebServer)
function createWebServer()
{
const app = express(); const app = express();
app.get('/api/values/:id', function (req, res) { app.get('/api/values/:id', function (req, res) {
@ -12,3 +19,5 @@ app.listen(5000, function () {
'Now listening on: http://localhost:5000\nApplication started. Press CTRL+C to shut down.' '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"
} }
} }