Article ID: 1265
Last updated: 26 Jul, 2020
These commands are universal for whatever OS you’ll be running. The former will create a new directory inside the directory you are currently in, mkdir = “make directory”. The latter will change into this newly created directory, cd = “change directory”.
Note : Npm is short for node package manager. This is where all node packages live. Packages can be viewed as bundles of code, like modules, which carry out a specific function. This functionality is what we as developers are utilizing. We use the application program interface, the API, provided for us by these modules.
var express = require('express');
var app = express();app.get('/', function (req, res) {
res.send('Hello World!');
});app.listen(8080, function () {
console.log('Example app listening on port 8080!');
});
Note: If you want to change the directory of your application, simply create the folder as per your need run:npm install express --save command in command prompt in the directory where you will be keeping your application, this command will add the express framework which is used for running node js application. Installing Window serviceInteractively
Non-interactively
This article was:
Report an issue
Article ID: 1265
Last updated: 26 Jul, 2020
Revision: 5
Views: 2077
Comments: 0
|