Ready to get started?

Join Adocasts Plus for $8.00/mo, or sign into your account to get access to all of our lessons.

robot mascot smiling

Splitting Our Routes Between Auth & Web

In this lesson, we'll split our routes into two files: auth and web. Our auth routes file will contain all our authentication-based route definitions and our web routes will contain the remaining.

Published
Oct 04, 24
Duration
5m 5s

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

Chapters

00:00 - Our Plan of Attack & Why We're Doing It
00:43 - Splitting Out Our Auth Routes
01:10 - Splitting Out Our Web Routes
02:30 - Updating Our AdonisRC Preloaded Files
03:55 - Disabling Linting & Prettier On Route Definitions

Ready to get started?

Join Adocasts Plus for $8.00/mo, or sign into your account to get access to all of our lessons.

Join The Discussion! (4 Comments)

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

  1. Commented 1 month ago

    I think that prettier-ignore-start only works for markdown files, as discussed in this issue (https://github.com/prettier/prettier/issues/5287). I'm not sure how you were able to disable prettier for your routes files, so I just added start/routes/**/*.ts to my .prettierignore.

    1

    Please sign in or sign up for free to reply

    1. Commented 1 month ago

      Hi Nathan! Huh - yeah it sure does. 🤔

      Oh snap, looks like I disabled Prettier formatting on save for TypeScript files at some point. So, Prettier just isn't running for me unless I paste or explicitly format, sorry about that! Your solution does look to be the recommended approach. I'm going to have to re-enable Prettier and add that myself. Thank you for sharing!!

      1

      Please sign in or sign up for free to reply

  2. Commented 1 month ago

    Hi, thank you for this content.
    Unfortunately , subtitles are wrong and correspond to the previous video.

    1

    Please sign in or sign up for free to reply

    1. Commented 1 month ago

      Terribly sorry about that, tigerwolf! The subtitles for this lesson have now been corrected. Thank you very much for the heads up!

      0

      Please sign in or sign up for free to reply