Running nodejs in an actual server.

sourav mandal
Feb 3, 2021

--

var express = require("express");var app = express();app.get("/", function(req, res) {
res.send("Hello World!");
});var server = app.listen(80, function() {
var host = server.address().address;
var port = server.address().port; console.log("GadgetEdge.net listening at http://%s:%s", host, port);
});

apt-get update

apt-get install nodejs

apt-get install npm

npm install pm2 -g

$ pm2 start app.js -i max

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

sourav mandal
sourav mandal

Written by sourav mandal

just a coder who forgets things so makes blogs so he can remember later

No responses yet

Write a response