File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
www/apps/book/app/learn/fundamentals/api-routes/middlewares Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ Middlewares are defined in the special file `src/api/middlewares.ts`. Use the `d
2727For example:
2828
2929``` ts title="src/api/middlewares.ts"
30- import type {
30+ import {
3131 defineMiddlewares ,
3232 MedusaNextFunction ,
3333 MedusaRequest ,
@@ -118,7 +118,7 @@ For example:
118118export const pathParamHighlights = [[" 11" , " :id" , " Indicates that the API route accepts an `id` path parameter." ]]
119119
120120``` ts title="src/api/middlewares.ts" collapsibleLines="1-7" expandMoreLabel="Show Imports" highlights={pathParamHighlights}
121- import type {
121+ import {
122122 MedusaNextFunction ,
123123 MedusaRequest ,
124124 MedusaResponse ,
@@ -150,7 +150,7 @@ For example:
150150export const highlights = [[" 12" , " method" , " Apply the middleware only on `POST` requests" ]]
151151
152152``` ts title="src/api/middlewares.ts" highlights={highlights} collapsibleLines="1-7" expandButtonLabel="Show Imports"
153- import type {
153+ import {
154154 MedusaNextFunction ,
155155 MedusaRequest ,
156156 MedusaResponse ,
@@ -183,7 +183,7 @@ A middleware whose `matcher` pattern doesn't end with a backslash won't be appli
183183For example, consider you have the following middleware:
184184
185185``` ts collapsibleLines="1-7" expandMoreLabel="Show Imports"
186- import type {
186+ import {
187187 MedusaNextFunction ,
188188 MedusaRequest ,
189189 MedusaResponse ,
@@ -214,4 +214,4 @@ If you send a request to `http://localhost:9000/custom`, the middleware will run
214214
215215However, if you send a request to ` http://localhost:9000/custom/ ` , the middleware won't run.
216216
217- In general, avoid adding trailing backslashes when sending requests to API routes.
217+ In general, avoid adding trailing backslashes when sending requests to API routes.
You can’t perform that action at this time.
0 commit comments