Skip to content

Commit

Permalink
fix cors instruction in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
karlseguin committed Dec 5, 2024
1 parent 39e978b commit ab02ff0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,14 +726,14 @@ const cors = try server.middleware(httpz.middleware.Cors, .{
// apply this middleware to all routes (unless the route
// explicitly opts out)
var router = server.router(.{.middlewares = .{cors}});
var router = server.router(.{.middlewares = &.{cors}});
// or we could add middleware on a route-per-route bassis
router.get("/v1/users", .{.middlewares = &.{cors}});
router.get("/v1/users", user, .{.middlewares = &.{cors}});
// by default, middlewares on a route are appended to the global middlewares
// we can replace them instead by specifying a middleware_strategy
router.get("/v1/metrics", .{.middlewares = &.{cors}, .middleware_strategy = .replace});
router.get("/v1/metrics", metrics, .{.middlewares = &.{cors}, .middleware_strategy = .replace});
```

## Cors
Expand Down

0 comments on commit ab02ff0

Please sign in to comment.