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
// Step1: create a package | |
npm init | |
// Step2: create index.js file in same folder as package.json and copy this code | |
const http = require('http'); | |
// Create an instance of the http server to handle HTTP requests | |
let app = http.createServer((req, res) => { | |
// Set a response type of plain text for the response | |
res.writeHead(200, {'Content-Type': 'text/plain'}); |