undefined

Router

The AdonisJS Router provides routing capabilities for AdonisJS applications. It allows grouping, param validation, sub-domains, middleware assignment, naming, and so much more. It integrates deeply with the HttpContext and Edge.

6 Series
57 Lessons
Router

AdonisJS Quick Tip

Quick tips, lessons, and screencasts covering specific topics on AdonisJS.

25 Lessons
2h 59m

Building with AdonisJS & Inertia

We'll learn how to use InertiaJS with AdonisJS 6 to build a feature-complete application, called PlotMyCourse. Our application will use server-side rendering (SSR), Vue 3, and Shadcn-Vue. It'll feature organizations, drag-and-drop, and lots of forms.

91 Lessons
14h 3m

Let's Learn AdonisJS 6

In this series, we'll learn AdonisJS 6 step-by-step in a beginner-friendly way. Covering topics like routing, controllers, services, EdgeJS, Lucid ORM, forms, filtering, authentication, etc.

113 Lessons
14h 15m

Let's Learn AdonisJS 5

Learn AdonisJS 5 in-depth as we step through all the major functionalities of the framework in-depth. Learn about Routing, Controllers, Lucid, Auth, and much more.

29 Lessons
5h 3m

Let's Build with AdonisJS

Livestreams where we build applications using AdonisJS 5. Starting out, we'll be rebuilding Adocasts, formerly called Jagr.Co.

12 Lessons
21h 39m

Let's Learn AdonisJS 5 Preview

In this series, we'll be doing a deep-dive into AdonisJS 5's Preview version. We'll learn about routing, controllers, the Lucid ORM, migrations, it's CLI, handling file uploads, transactional email, and much more.

16 Lessons
3h 37m

Discussions

Passing parameters to the router line

@oliverwhite
@oliverwhite

Hello, sorry to bother you, but could you tell me if it is possible to build a URL address in which the :city parameter will specify different cities, for example: /fly-to-amsterdam or /fly-to-parisI tried to make a router like /fly-to-:city...

3
2,015
Video preview
Route Groups & Middleware
Video preview

Middleware & Grouping Routes

Learn AdonisJS middleware for intercepting HTTP requests. Control request flow, implement logging, and secure your applications.

Video preview
Manual & Automatic Route Identifiers
Video preview

Route Names & Type-Safe Route Generation

Learn type-safe route generation in AdonisJS using route names. Generate URLs with named routes for maintainable links and redirects. We'll also inspect the generated type for our route definitions and default route naming.

Video preview
Barrel Files & Controllers
Video preview

Controllers, Barrel Files, & Subpath Imports

Learn AdonisJS controllers, barrel files, and subpath imports. Organize code with controllers and leverage barrel files for cleaner imports.

Video preview
Route Parameters & Matchers
Video preview

Route Parameters & Matchers

Learn AdonisJS route parameters and matchers. Capture dynamic segments in URLs and validate and cast with route matchers.

Video preview
All About View State
Video preview

View State & Passing Data to Views

Learn how to pass data from controllers to views using state in AdonisJS. We'll also discuss the three different types of state in EdgeJS: render, local, and global.

Video preview
Routes & Rendering Views
Video preview

Defining Routes & Rendering Views

Learn how to define routes and render views in AdonisJS. Understand route definitions, rendering views, and the router service.

Video preview
Full-Text Search
Video preview

Performing Full-Text Search

In this lesson, we'll learn how to perform a full-text search with Meilisearch while also building the structural base for what will eventually serve as our multi-search autocomplete.

Video preview
Redirect back after login
Video preview

How To Redirect Back to the Previous Page After Login with AdonisJS

In this lesson, we'll learn an easy way we can safely redirect our user's back to their original page after they login or register in an AdonisJS application. We'll also verify the URL matches an actual GET route definition within our application.

Video preview
Basic Course Filtering
Video preview

Basic Course Search & Filter

In this lesson, we'll add a new search endpoint for our courses and enable some basic filter functionality along with it. We'll be able to search by course name likeness, status, difficulty, and/or access level.

Router
AdonisJS

Require Route Parameter To Start With @ To Match

You can use route matchers to specify requirements on the route parameter. In this snippet, we require our username param to start with the @ character for the route to match.