Skip to content

jankleinert/redis-session-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-session-demo overview

Demo app that shows session management for a Node.js app using express-sessions and connect-redis. Originally created for Redis Day NYC 2019: https://events.redislabs.com/sessions/life-user-session/

The app queries an API for ML-generated craft beer names and displays them on the page. There is a session management panel that displays session ID, time until the session expires, and the number of beer names viewed in that session.

Learn more about how it works in this tutorial:

how to run

Make sure you have have Redis server running locally:

redis-server

Then clone this repo, run npm install and then run it in dev mode:

git clone https://github.com/jankleinert/redis-session-demo
cd redis-session-demo
npm install
export SESSION_SECRET=<some value you choose>
npm run dev

Then in your browser, go to http://localhost:3000. It should look something like this:

screenshot

how it works

This demo uses express-session for session management and connect-redis as the session store.

branches

The master branch contains the app with simple session management.

The auth branch will add in authentication using passport.js.

About

Demo app that shows session management for a Node.js app using express-sessions and connect-redis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published