Created
May 31, 2017 18:06
-
-
Save kunigami/0a02c07ba5f7f1a4fbe4d1123928b6f5 to your computer and use it in GitHub Desktop.
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 url = require('url'); | |
var fs = require('fs'); | |
// Read the HTML file | |
var htmlFile; | |
fs.readFile('./response.html', function(err, data) { | |
if (err) { | |
throw err; | |
} | |
htmlFile = data; | |
}); | |
http.createServer(function (request, response) { | |
response.writeHead(200, {'Content-Type': 'text/html'}); | |
response.end(htmlFile); | |
}).listen(3000, "127.0.0.1"); | |
console.log('server running'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment