Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created June 2, 2020 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/3dfcbb12b5375e894a71d919d4b6eb52 to your computer and use it in GitHub Desktop.
Save parzibyte/3dfcbb12b5375e894a71d919d4b6eb52 to your computer and use it in GitHub Desktop.
app.get("/ruta_solo_logueados", (req, res) => {
// Si, por ejemplo, no hay nombre
if(!req.session.nombre){
res.end("No tienes permiso. Fuera de aquí");
}else{
// Ok, el usuario tiene permiso
res.end("Hola " + req.session.nombre);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment