Skip to content
0:00 / 0:00

#express#redis#refactoring

Sessions in Node #5 | Authentication in Node.js with Express and sessions | refactoring codebase

Jan Goebel

13K subscribers • 7 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Jan Goebel
  • Linked in the descriptionproductioncoder/express-session-with-redis
  • May be out of date. The tools, versions or practices it shows have likely moved on.

Intermediate. Assumes working knowledge.

4.6K views6 years ago1 recommendation

Web developmentSoftware designNode.js, Deno and BunRefactoring and legacy codeSoftware architecture

Jan Goebel demonstrates how to refactor an Express and Redis session authentication codebase by splitting logic into controllers and middleware.

🔥More exclusive content: productioncoder.com/you-decide-what-we-build-next Twitter: twitter.com/_jgoebel Blog: productioncoder.com Code: github.com/productioncoder/express-session-with-redis Learn how to build a cookie and session-based authentication system with the Node express.js framework and the Redis in memory store. This part 5 of our series in which we continue refactoring our already working application so split functionality over multiple files. - rationale for moving request handling to controller - moving login logic to authentication controller - wiring up authentication controller in routes file - moving protected route request handling to a controller - moving session middleware to a separate file - move connect-redis to our session middleware - move redis client to its own file - wiring up redis client with express-session middleware - wiring up session middleware with express server - cleaning up main index.js file

Why it's here

1 person recommends this

u/prodcoderin r/node • Recommends

Sessions in Node #5 | Authentication in Node.js with Express and sessions | refactoring codebase