Le dump
This commit is contained in:
parent
47e66cccbb
commit
100c93ffe4
5 changed files with 262 additions and 0 deletions
17
examples/HelloWorld.js
Normal file
17
examples/HelloWorld.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const uWS = require('../dist/uws.js');
|
||||
|
||||
const port = 3000;
|
||||
|
||||
uWS.App().get('/hello', (res, req) => {
|
||||
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) => {
|
||||
if (token) {
|
||||
console.log('Listening to port ' + port);
|
||||
} else {
|
||||
console.log('Failed to listen to port ' + port);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Timers will not work until us_loop_integrate is done');
|
Loading…
Add table
Add a link
Reference in a new issue