WhiteDog

Is deleting???

1 -var http = require('http');
2 -
3 -http.createServer(function (req, res) {
4 - var path = req.url.replace(/\/?(?:\?.*)?$/, '').toLowerCase();
5 - switch (path) {
6 - case '':
7 - res.writeHead(200, { 'Content-Type': 'text/plain' });
8 - res.end('Homepage');
9 - break;
10 - case '/about':
11 - res.writeHead(200, { 'Content-Type': 'text/plain' });
12 - res.end('About');
13 - default:
14 - res.writeHead(404, { 'Content-Type': 'text/plain' });
15 - res.end('Not Found');
16 - break;
17 - }
18 -}).listen(3000);
19 -
20 -console.log('Server started on localhost:3000; press Ctrl-C to terminate....');
...\ No newline at end of file ...\ No newline at end of file
File mode changed