Replace one template with another in nodejs

0

I have a doubt .. Attach a button to close session.

You already create the event and everything is fine. But how can I tell the server to send me the welcome page?

Use nodejs server. And in the front javascript ...

The welcome page is a pug template

    
asked by José Llamas 28.01.2018 в 00:25
source

1 answer

0

You can redirect to the welcome screen after hitting the endpoint that makes the logout.

app.get('/logout', function(req, res, next) {
   // acá haces la lógica de logout, como matar la sesión
   res.redirect('/bienvenida');
});

app.get('/bienvenida', function(req, res, next) {
   res.render('bienvenida');
});
    
answered by 30.01.2018 в 13:53