I’ve seen the same question posted, but not many helpful answers. I would like to render the welcome page once I’ve done content of the app.post, but nothing happens.
I know it’s valid as it will give me an error if i enter an invalid route, but it just will not do what i would like.
app.get('/', function (req, res) {
res.render('Welcome')
})
app.post('/makepost', function (req, res) {
//do some things
res.render('Welcome');
})
In the View I use this to call the app.post.
fetch('/makepost', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: body,
}