You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
350 B
16 lines
350 B
5 years ago
|
const express = require('express')
|
||
|
const app = express()
|
||
|
var cookieParser = require('cookie-parser')
|
||
|
|
||
|
app.use(cookieParser())
|
||
|
|
||
|
app.get('/login/:name', (req, res)=>{
|
||
|
res.cookie("name",req.params.name);
|
||
|
res.send()
|
||
|
})
|
||
|
|
||
|
app.get('/hello',(req,res)=>{
|
||
|
res.send(`Welcome ${req.cookies.name}!`);
|
||
|
})
|
||
|
|
||
|
app.listen(8000,()=>{console.log("Started server!")})
|