Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
npm i @fastify/cors
```

TypeScript note: `@fastify/cors` does not add Fastify decorators, so registering it preserves the existing instance, request, and reply shapes.

### Compatibility

| Plugin version | Fastify version |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"c8": "^11.0.0",
"cors": "^2.8.5",
"eslint": "^9.17.0",
"fastify": "^5.0.0",
"fastify": "github:fastify/fastify#feat/typed-decorators",
"neostandard": "^0.12.0",
"tsd": "^0.33.0",
"typescript": "~5.9.2"
Expand Down
2 changes: 1 addition & 1 deletion types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import fastifyCors, {

const app = fastify()

app.register(fastifyCors)
expectType<typeof app>(app.register(fastifyCors))

app.register(fastifyCors, {
origin: true,
Expand Down
Loading