Node.js 11, uWS.nextTick, purely V8
This commit is contained in:
parent
100c93ffe4
commit
9e1b05608e
4 changed files with 124 additions and 83 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue