Answers for "app express js"

57

create express app

## 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
Posted by: Guest on June-11-2021
14

node js express

basic server

const express =require('express');
const app = express();
const PORT = 5000;


app.get('/',(req,res)=>{
   res.json({message: 'Welcome to the backend'})
})


app.listen(PORT ,()=>console.log(`Connected to ${PORT}`)
Posted by: Guest on April-02-2020
6

require express server.js

const express = require('express')const app = express() app.get('/', function (req, res) {  res.send('Hello World')}) app.listen(3000)
Posted by: Guest on March-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language