Skip to content

Commit

Permalink
docs(plugins): rename as Qwik Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickJS committed May 5, 2024
1 parent 6223390 commit a980f4c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---
title: Plugins | Qwik City
title: Qwik Plugins | Qwik City
description: Learn about advanced routing in Qwik City, including 404 page handling, grouped layouts, named layouts, nested layouts, and plugin.ts files.
contributors:
- patrickjs
updated_at: '2024-05-05T16:20:00Z'
created_at: '2024-05-05T16:20:00Z'
---

# Plugins with `plugin@<name>.ts`
# Qwik Plugins
Qwik plugins, named as `plugin.ts` or `plugin@<name>.ts`, handle incoming requests prior to root layout execution and are located in the `src/routes` directory. Request handlers like `onRequest`, `onGet`, `onPost` in these plugins are called before `server$` functions. For multiple plugins, `plugin.ts` handlers execute first, followed by `plugin@<name>.ts` handlers in alphabetical order. Middleware functions should be defined in `plugin.ts` to ensure execution for all requests.


# `plugin@<name>.ts`

`plugin.ts` and `plugin@<name>.ts` files can be created in the root of the `src/routes` directory to handle any incoming request before even the root layout executes.

Expand Down

0 comments on commit a980f4c

Please sign in to comment.