Answers for "how to add a handler with custom parameters in express"

49

express js example

//to run : node filename.js
const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))

//visit localhost:3000
// assuming you have done 1) npm init 2) npm install express
Posted by: Guest on July-17-2020
0

route parameter in node

var express = require('express');
var fs  = require('fs');
var app= express();
 app.get('/index/profile/:id',function(req,res){
    //  res.send('profile with id' + req.params.id)

    
    
 });
app.listen(3000,'127.0.0.1');
console.log('lsitng');
Posted by: Guest on May-26-2020

Code answers related to "how to add a handler with custom parameters in express"

Code answers related to "Javascript"

Browse Popular Code Answers by Language