diff --git a/docs/content/1.guide/3.routing.md b/docs/content/1.guide/3.routing.md index 529af91258..617ca0f9e0 100644 --- a/docs/content/1.guide/3.routing.md +++ b/docs/content/1.guide/3.routing.md @@ -172,6 +172,7 @@ nitro.config.ts ### Simple Middleware Middleware are defined exactly like route handlers with the only exception that they should not return anything. +Returning from middleware behaves like returning from a request - the value will be returned as a response and further code will not be ran. ```ts [middleware/auth.ts] export default defineEventHandler((event) => { @@ -181,7 +182,7 @@ export default defineEventHandler((event) => { ``` ::alert -Returning anything from a middleware will close the request and should be avoided! +Returning anything from a middleware will close the request and should be avoided! Any returned value from middleware will be the response and further code will not be executed however **this is not recommended to do!** :: ### Execution Order