• Docs
  • Modules
  • Templates
  • Resources
  • Enterprise
  • Blog
58.3K
  • Get Started
  • Guide
  • API
  • Deploy
  • Examples
  • Community
  • Hello World
    • Auto Imports
    • Data Fetching
    • State Management
    • Meta Tags
    • Layouts
    • Middleware
    • Pages
    • Universal Router
    • Layers
    • Error Handling
    • JSX / TSX
    • Locale
    • Module Extend Pages
    • Teleport
    • Testing
    • useCookie
    • Use Custom Fetch Composable
    • WASM
  1. Examples
  2. Routing

Middleware

This example shows how to add route middleware with the middleware/ directory or with a plugin, and how to use them globally or per page.
Read more in Docs > Guide > Directory Structure > Middleware.
Loading Sandbox...
Was this helpful?
Report an issue or Edit this page on GitHub

Layouts

This example shows how to define default and custom layouts.

Pages

This example shows how to use the pages/ directory to create application routes.

Community

  • Become a Sponsor
  • Master Nuxt
  • Nuxt Certification
Nuxt on DiscordNuxt on BlueskyNuxt on XNuxt on GitHub

Community

  • Nuxters
  • Team
  • Design Kit

Products

  • Nuxt UI Pro
  • Nuxt Studio
  • NuxtHub
  • Docus

Enterprise

  • Support
  • Agencies
  • Sponsors

Stay updated on new releases and features, guides, and community updates.

Nuxt on XNuxt on BlueSkyNuxt on LinkedInNuxt on DiscordNuxt on GitHub

Copyright © 2016-2025 Nuxt - MIT License