OLD | NEW |
(Empty) | |
| 1 #library('httpServer'); |
| 2 |
| 3 #import('../../lib/node/node.dart'); |
| 4 #import('../../lib/node/http.dart'); |
| 5 |
| 6 void main() { |
| 7 // Note: the callback function must use the actual types for the arguments, |
| 8 // otherwise frog will strip out the type's methods. |
| 9 http.createServer((ServerRequest req, ServerResponse res) { |
| 10 res.writeHead(200, '', {'Content-Type': 'text/plain'}); |
| 11 res.end('Hello World\n'); |
| 12 }).listen(1337, "127.0.0.1"); |
| 13 console.log('Server running at http://127.0.0.1:1337/'); |
| 14 } |
OLD | NEW |