Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Commit

Permalink
Hello World via Node.JS server. Start using 'node helloworld.js'
Browse files Browse the repository at this point in the history
  • Loading branch information
easterncalculus committed Oct 1, 2018
1 parent 168bedb commit f4cd09a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions easterncalculus/helloworld.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const http = require('http');
const hostname = '127.0.0.1';
const port = 12345;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World!');
});

server.listen(port, hostname, () => {
console.log(`Server running. Please check: http://${hostname}:${port}/`);
});

0 comments on commit f4cd09a

Please sign in to comment.