Skip to content

Commit 70b3e16

Browse files
authored
docs: fix import of defineMiddleware (medusajs#11293)
1 parent ddaeafa commit 70b3e16

File tree

1 file changed

+5
-5
lines changed
  • www/apps/book/app/learn/fundamentals/api-routes/middlewares

1 file changed

+5
-5
lines changed

www/apps/book/app/learn/fundamentals/api-routes/middlewares/page.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Middlewares are defined in the special file `src/api/middlewares.ts`. Use the `d
2727
For 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:
118118
export 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:
150150
export 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
183183
For 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

215215
However, 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.

0 commit comments

Comments
 (0)