article

Showing posts with label Node.js. Show all posts
Showing posts with label Node.js. Show all posts

Wednesday, September 22, 2021

How to install node.js on Mac and run nodejs hello program

How to install node.js on Mac and run nodejs hello program hello.js
const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

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 at http://${hostname}:${port}/`);
});

Wednesday, June 30, 2021

Getting started With NodeJS and ExpressJS in Windows 10

Getting started With NodeJS and ExpressJS in Windows 10

Expressjs is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications. It facilitates the rapid development of Node based Web applications. Following are some of the core features of Express framework −

Allows to set up middlewares to respond to HTTP Requests.

Defines a routing table which is used to perform different actions based on HTTP Method and URL.

Allows to dynamically render HTML Pages based on passing arguments to templates.

run
PS C:\nodeproject>node index.js

PS C:\nodeproject> node index.js
Example app listening at http://localhost:3000

Monday, December 7, 2020

How to install node.js on windows 10 and run first node.js hello program

How to install node.js on windows 10 and run first node.js hello program

Node.js is an open source framework that allows us to run JavaScript on the server. The Node.js is very memory efficient as it runs as single-threaded, non-blocking and asynchronously. It supports all major platform like Windows, Linux, Unix, Mac etc. Due to Node.js awesome features, it becomes popular among web developers to develop dynamic web projects.

Related Post