// this is your code
// ZDev1#4511 on discord if you want more help!
// first you should install express in the terminal
// `npm i express`.
const express = require('express');
const app = express();
// route
app.get('/', (req,res)=>{
// Sending This is the home page! in the page
res.send('This is the home page!');
});
// Listening to the port
let PORT = 3000;
app.listen(PORT)
// FINISH!
## Command
$ npx express-generator
: 'For earlier Node versions, install the application generator as a global
npm package and then launch it':
$ npm install -g express-generator
$ express
## Display the command options with the -h option:
$ express -h
npm i express -g
express --view=pug myapp
//in terminal write
npm install express
$ npx express-generator
var express=require('express');
var app=express();
app.get('/',function(req,res){
res.send("Hello World!");
});
var server=app.listen(3000,function() {});
mkdir api-project
cd api-project
npm init
npm install express --save
express my-app --view=ejs
cd my-app
nodemon start
//Creates an Express application. The express() function is a top-level function exported by the express module.
var express = require('express')
var app = express()