Question : nodejs express api
Answered by : comfortable-caribou-ioh1qokej6j6
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}`)
})
Source : https://expressjs.com | Last Update : Thu, 22 Apr 21
Question : express api make
Answered by : volkan
const express = require('express')
const app = express()
const port = 3000
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.get('/users/name', (req, res) => {// users/name?name=Alex return res.send( `How are you ${req.query.name} !`, ); // How are you Alex
});
app.get('/users/:userId', (req, res) => {// users/Alex return res.send( `How are you ${req.params.name} !`, );// How are you Alex
});
app.listen(port, () => { console.log(`Example app listening at http://localhost:${port}`)
})
Source : | Last Update : Thu, 05 May 22
Question : express api
Answered by : weary-wasp-k4p5bnou8tlc
app.render('email', function (err, html) { // ...
})
app.render('email', { name: 'Tobi' }, function (err, html) { // ...
})
Source : http://expressjs.com/en/api.html#app.render | Last Update : Fri, 12 Feb 21