Nuxt/examples/routing/middleware/plugins/add.ts
Clément Ollivier 1a7b570c82
docs(examples): add examples to docs (#3966)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2022-03-30 17:59:28 +02:00

10 lines
286 B
TypeScript

export default defineNuxtPlugin(() => {
addRouteMiddleware('global-test', () => {
console.log('this global middleware was added in a plugin')
}, { global: true })
addRouteMiddleware('named-test', () => {
console.log('this named middleware was added in a plugin')
})
})