Computer Science, asked by anianushaj999, 5 months ago

var express = require('express')
var app = express()
var d=new Date()
var requestTime = function (req, res, next) {
req.requestTime = d.toLocaleString()
next()
}

app.use(requestTime)

app.get('/', function (req, res) {
var responseText = ''
responseText += '<small>Requested at: ' + req.requestTime + '</small>'
res.send(responseText)
})

app.listen(3000)
console.log('server started')

explain

Answers

Answered by poonamvermaindore123
0

Answer:

first taking an var and declared that

then requested to have app brake

app get library used here then called function

Similar questions