app.get(’/’, (req, res) => {
console.log(‘this is /’)
})
app.get(’/add’,(req,res)=>{
/// from this /add requet how i can goes to / request
}
app.get(’/’, (req, res) => {
console.log(‘this is /’)
})
app.get(’/add’,(req,res)=>{
/// from this /add requet how i can goes to / request
}
You should use res.redirect: https://expressjs.com/en/4x/api.html#res.redirect
app.get(’/’, (req, res) => {
console.log(‘this is /’)
})
app.get(’/add’,(req,res)=>{
res.redirect("/");
}