Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 29, 2021 18:53
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/7fe1dc9e4a2fdada2c298371243f4f4e to your computer and use it in GitHub Desktop.
Save parzibyte/7fe1dc9e4a2fdada2c298371243f4f4e to your computer and use it in GitHub Desktop.
// Primero usar la sesión
app.use(session({
// Se recomienda cambiar en cada entorno
// https://parzibyte.me/blog/2020/06/02/sesiones-node-express-js/#Configurar_uso_de_sesion
secret: "123",
saveUninitialized: true,
resave: true,
cookie:{
maxAge: 60000,
}
}));
// Y después definir las rutas!
app.use('/', indexRouter);
app.use('/productos', productosRouter);
app.use('/usuarios', usuariosRouter);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment