Node.js 11, uWS.nextTick, purely V8

This commit is contained in:
Alex Hultman 2018-11-03 12:35:42 +01:00
parent 100c93ffe4
commit 9e1b05608e
4 changed files with 124 additions and 83 deletions

View file

@ -2,8 +2,10 @@ const uWS = require('../dist/uws.js');
const port = 3000;
const world = new (require('util').TextEncoder)().encode('World!');
uWS.App().get('/hello', (res, req) => {
res.end('world!');
res.end(world);
}).get('/*', (res, req) => {
res.writeHeader('content-type', 'text/html; charset= utf-8').end(req.getHeader('user-agent') + ' är din user agent, biatch!');
}).listen(port, (token) => {