Created
August 18, 2019 21:16
-
-
Save caesaneer/bb5b2b9f23f203ad54cf0cf2e3181238 to your computer and use it in GitHub Desktop.
Node.js - Single Process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const bench = require('./bench') | |
const host = '192.168.0.14' | |
const port = 8000 | |
const start = function startServer() { | |
// Simple request router | |
const router = function requestRouter(request, reply) { | |
const result = bench(100) | |
// console.log(result) | |
reply.end('OK') | |
} | |
// Start HTTP server | |
const server = http.createServer(router) | |
server.listen(port, host, () => { | |
console.log(`Node.js Standard Library HTTP server running on port: ${port}`) | |
}) | |
} | |
start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment