Skip to content

Commit

Permalink
fix: support cors
Browse files Browse the repository at this point in the history
  • Loading branch information
DCsunset committed Oct 10, 2023
1 parent 586b377 commit 7409076
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"typescript": "^5.0.2"
},
"dependencies": {
"@fastify/cors": "^8.4.0",
"@fastify/jwt": "^6.7.1",
"fastify": "^4.15.0"
}
Expand Down
2 changes: 2 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import Fastify from "fastify";
import fastifyJwt from "@fastify/jwt";
import fastifyCors from "@fastify/cors";

import { HttpError } from "./types/error.js";
import { loadData, saveData, deleteData } from './utils/data.js';
Expand All @@ -33,6 +34,7 @@ fastify.register(fastifyJwt, {
}
});

fastify.register(fastifyCors);

// Create a session (log in)
fastify.post("/session", {
Expand Down

0 comments on commit 7409076

Please sign in to comment.