Files: ca90b5ca0579ebdcc0635288bce4978e3fb200f5 / test / test-79-npm / feathers / feathers.js
620 bytesRaw
1 | ; |
2 | |
3 | var feathers = require('feathers'); |
4 | var http = require('http'); |
5 | var app = feathers(); |
6 | |
7 | app.get('/', function (req, res) { |
8 | res.end('Hello there!'); |
9 | }); |
10 | |
11 | var server = app.listen(1337, function () { |
12 | var port = server.address().port; |
13 | setTimeout(function () { |
14 | http.get('http://127.0.0.1:' + port.toString() + '/', function (res) { |
15 | var chunks = ''; |
16 | res.on('data', function (chunk) { |
17 | chunks += chunk.toString(); |
18 | }).on('end', function () { |
19 | if (chunks === 'Hello there!') { |
20 | console.log('ok'); |
21 | } |
22 | server.close(); |
23 | }); |
24 | }); |
25 | }, 100); |
26 | }); |
27 |
Built with git-ssb-web