mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 02:31:04 +01:00
Fix NodeJS benchmark
Former-commit-id: a1d87cf3a3f4790b9e392dc3c100180284286797
This commit is contained in:
parent
f4b4742eca
commit
d1cc5599b6
|
@ -1,14 +1,23 @@
|
|||
process.env.NODE_ENV = 'production';
|
||||
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const express = require('express');
|
||||
const createWorker = require('throng')
|
||||
|
||||
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.'
|
||||
)
|
||||
});
|
||||
createWorker(createWebServer)
|
||||
|
||||
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.'
|
||||
)
|
||||
});
|
||||
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
"author": "Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.16.0"
|
||||
"express": "^4.16.0",
|
||||
"throng": "4.0.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user