adonisjs-routing

Organize AdonisJS routes with middleware and Bouncer authorization patterns.

2|1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/omakei/adonisjs-architecture-skill --skill adonisjs-routing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adonisjs-routing
Source: https://github.com/omakei/adonisjs-architecture-skill/tree/main/adonisjs/skills/adonisjs-routing
Command: npx skills add https://github.com/omakei/adonisjs-architecture-skill --skill adonisjs-routing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

AdonisJS routing, middleware, and permission patterns are essential for building scalable, secure web APIs. This skill provides a cohesive guide to organize routes, apply middleware stacks, and enforce authorization using Bouncer policies and route-level guards across large apps.

Core Features & Use Cases

  • Route definition patterns: get, post, put, delete, and resource routes with grouped patterns for consistency.
  • Route groups and versioning: nest routes under prefixes and API version groups with shared middleware.
  • Middleware patterns: server, router, and named middleware to compose stable request handling and guards.
  • Permission patterns: Bouncer abilities, policies, and route-level can middleware to enforce per-user access.
  • Project organization: directory structure guidance and testing strategies for route security.
  • Reference implementations: shows concrete TypeScript examples and testing patterns.

Quick Start

Define routes using router methods, apply middleware, and enforce permissions with Bouncer in your project.

Frequently Asked Questions about adonisjs-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up RBAC authorization in AdonisJS using Bouncer policies?

AdonisJS RBAC authorization is enforced by defining Bouncer abilities and per-model policies, then applying the route-level can middleware to guard specific endpoints. This restricts access based on granular user permissions across your application.

How do I organize AdonisJS routes with middleware groups and API versioning?

AdonisJS routes can be organized by nesting them under route groups with shared prefixes, applying named middleware, and structuring API version groups. This ensures consistent request handling and scalable directory organization for large projects.

What is the difference between server, router, and named middleware in AdonisJS?

AdonisJS middleware types compose request handling at different scopes. Server middleware runs globally, router middleware applies to all routes, and named middleware is selectively attached to specific routes or groups to enforce guards like authorization.

How do I apply Bouncer can middleware to AdonisJS resource routes?

AdonisJS resource routes are protected by attaching the Bouncer can middleware directly to the resource definition. This enforces policy-based authorization checks for standard CRUD operations like get, post, put, and delete.

Does this approach support testing strategies for route security in large AdonisJS apps?

Yes, organizing AdonisJS routing with Bouncer policies includes reference implementations and testing strategies for route security. You can verify authorization patterns and middleware guards within your TypeScript project structure.