Skip to content

Commit

Permalink
enable cors for all requests (#660)
Browse files Browse the repository at this point in the history
* enable cors for all

* added changeset
  • Loading branch information
esterlus authored Aug 30, 2024
1 parent bd93b10 commit 848f613
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/flat-panthers-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rpch/discovery-platform': minor
---

Enable cors for all requests
3 changes: 2 additions & 1 deletion apps/discovery-platform/src/entry-server/routers/v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const log = Utils.logger(['discovery-platform', 'router']);
// Express Router
export const v1Router = (ops: { dbPool: Pool; secrets: Secrets; url: string }) => {
const router = express.Router();
router.use(cors({ origin: true, credentials: true }));
// enable cors for all origins (needed for uHTTP integration into websites)
router.use(cors());
router.use(express.json());

// log entry calls
Expand Down

0 comments on commit 848f613

Please sign in to comment.