Skip to content

Commit

Permalink
v2.0.3 Fixed: CORS Friendly, can now be fetched from websites
Browse files Browse the repository at this point in the history
Fixed:
- Now accepts every origin for CORS. Can be used from every websites
  • Loading branch information
TheGeeKing committed Mar 22, 2024
1 parent a234a82 commit abf253f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
28 changes: 28 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 @@ -5,6 +5,7 @@
},
"dependencies": {
"@fastify/compress": "^7.0.0",
"@fastify/cors": "^9.0.1",
"axios": "^1.6.7",
"dotenv": "^16.4.5",
"fastify": "^4.26.2",
Expand Down
5 changes: 5 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fastify from "fastify";
import cors from "@fastify/cors";
import zlib from "zlib";
import axios from "axios";
import ical from "node-ical";
Expand Down Expand Up @@ -45,6 +46,10 @@ await app.register(import("@fastify/compress"), {
},
});

await app.register(cors, {
origin: "*", // allow all origins
});

// Create a Knex instance with SQLite3 as the client
const db = knex({
client: "sqlite3",
Expand Down

0 comments on commit abf253f

Please sign in to comment.