Skip to content

Commit 016f94e

Browse files
authored
docs: fix minor issues in middleware docs (#3436)
1 parent b4bb004 commit 016f94e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docs/latest/concepts/middleware.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ excellent way to make http-related logic reusable on the server.
3939
Use the `define.middleware()` helper to get typings out of the box:
4040

4141
```ts middleware/my-middleware.ts
42-
import { define } from "./utils.ts";
42+
import { define } from "../utils.ts";
4343

4444
const middleware = define.middleware(async (ctx) => {
4545
console.log("my middleware");
@@ -52,16 +52,16 @@ const middleware = define.middleware(async (ctx) => {
5252
Fresh ships with the following middlewares built-in:
5353

5454
- [cors()](/docs/plugins/cors) - Set CORS HTTP headers
55-
- [csrf()](/docs/plugins/cors) - Set CSRF HTTP headers
55+
- [csrf()](/docs/plugins/csrf) - Set CSRF HTTP headers
5656
- [trailingSlash()](/docs/plugins/trailing-slashes) - Enforce trailing slashes
5757

5858
## Filesystem-based middlewares
5959

6060
With file system based routing you can define a middleware in a `_middleware.ts`
6161
file inside the `routes/` folder or any of it's subfolders.
6262

63-
```ts routes/foo/_middleware.ts
64-
import { define } from "./utils.ts";
63+
```ts routes/_middleware.ts
64+
import { define } from "../utils.ts";
6565

6666
export default define.middleware(async (ctx) => {
6767
console.log("my middleware");
@@ -71,8 +71,8 @@ export default define.middleware(async (ctx) => {
7171

7272
You can also export an array of middlewares:
7373

74-
```ts routes/foo/_middleware.ts
75-
import { define } from "./utils.ts";
74+
```ts routes/_middleware.ts
75+
import { define } from "../utils.ts";
7676

7777
const middleware1 = define.middleware(async (ctx) => {
7878
console.log("A");

0 commit comments

Comments
 (0)