$ npx express-generator
mkdir api-project
cd api-project
npm init
npm install express --save
npm init => give name,description
npm i express
//create app.js
const express = require('express')
const app = express()
//create route
app.get('/',(req,res)=> {
//res.status(200).send("Hello from server side.")
res.json({message:"Hello from the server side"}) //passing json.
})
app.post('/',(req,res)=> {
res.send("You can post to this endpoint..")
})
//start server
const port = 3000
app.listen(port,()=> {
console.log(`App running on port ${port}...`)
})