Last active
December 20, 2017 21:35
-
-
Save zackbiernat/ad782040b32495617df86c0455be5c33 to your computer and use it in GitHub Desktop.
10 Line Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var fs = require('fs'); | |
var server = http.createServer((request, response) => { | |
response.writeHead(200, { | |
'Content-Type': 'text/html' | |
}); | |
fs.readFile(__dirname + '/index.html', (err, contents) => { | |
response.end(contents); | |
}) | |
}).listen(3000, '127.0.0.1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment