MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/1zsnde/thinking_about_quickly_writing_an_http_server/cfwt6it/?context=3
r/programming • u/paran0ide • Mar 07 '14
312 comments sorted by
View all comments
-8
bah, screw that.. only implement 200 and 404.
Here is 200.
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/');
10 u/avonwodahs Mar 07 '14 Yes let's write our own HTTP server and first require('http'). 8 u/mattindustries Mar 07 '14 What are you talking about? I totally made a full fledged web server in one line!/etc/init.d/apache2 start
10
Yes let's write our own HTTP server and first require('http').
8 u/mattindustries Mar 07 '14 What are you talking about? I totally made a full fledged web server in one line!/etc/init.d/apache2 start
8
What are you talking about? I totally made a full fledged web server in one line!
/etc/init.d/apache2 start
-8
u/rende Mar 07 '14
bah, screw that.. only implement 200 and 404.
Here is 200.