How do you create a hello world Node JS application

npm init

npm install express --save

var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});


node app.js

Comments

Popular posts from this blog

What is a Callback function in Node.js?

What is an Event loop in Node.js and how does it work?