Update via Query Parameter – Nodejs Tutorial 5

Update via Query Parameter – Nodejs Tutorial 5

Source Code

// updating data using query parameter
// import express
const express = require(“express”)
// new app
const app = express()
// new fruits array
fruits=[]
// new route for
app.get(“/:index”, (req,res)=>{
// add query parameter
// let update our fruits array
fruits.push(req.params.index)
// lets show data to end user
res.send(fruits)
})
// listen and serve
app.listen(8080)
Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: