The Flow of Middleware

In this lesson, we'll learn about the middleware that comes preinstalled within AdonisJS and the flow of this middleware during an HTTP Request at both a global and route-specific scale.

Published
Apr 20, 24
Duration
7m 49s

Developer, dog lover, and burrito eater. Currently teaching AdonisJS, a fully featured NodeJS framework, and running Adocasts where I post new lessons weekly. Professionally, I work with JavaScript, .Net C#, and SQL Server.

Adocasts

Burlington, KY

Get the Code

Download or explore the source code for this lesson on GitHub

Repository

Join The Discussion! (2 Comments)

Please sign in or sign up for free to join in on the dicussion.

  1. Commented 10 months ago

    Why do you apply the guest middleware for each route instead of applying it to the entire group?

    1

    Please sign in or sign up for free to reply

    1. Commented 10 months ago

      Hey Guy! I'm applying them here to the individual routes because, in a couple of lessons, we'll be adding a logout route that only authenticated users will be using. So guest won't apply to the whole group.

      1

      Please sign in or sign up for free to reply

Playing Next Lesson In
seconds