programmingconcepts
Version:
This is test module for Programming Concepts Node JS Application
17 lines (13 loc) • 534 B
JavaScript
var http = require('http');
var dt = require('./myFirstModule');
http.createServer(function(request, response){
// Send the HTTP header
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/html'});
response.write("The date and time are currently: " + dt.myDateTime() + " ");
// Send the response body as "Hello World"
response.end("Hello World!!!");
}).listen(8080);
// Console will print the message
console.log('Server running at http://127.0.0.1:8080/');