Skip to content

Commit

Permalink
🔒️ Add cors for bookstore api (#1988)
Browse files Browse the repository at this point in the history
* 🔒️ Add cors for bookstore api

* ➕ Add cors in src
  • Loading branch information
williamchong authored Dec 18, 2024
1 parent 2c4dd95 commit 6655649
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions/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 functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"body-parser": "^1.18.3",
"chokidar": "^3.5.3",
"cookie-parser": "^1.4.4",
"cors": "^2.8.5",
"cosmjs-types": "^0.8.0",
"create-hash": "^1.2.0",
"crisp-api": "^9.0.0",
Expand Down
13 changes: 13 additions & 0 deletions src/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 src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"body-parser": "^1.18.3",
"consola": "^2.5.6",
"cookie-parser": "^1.4.4",
"cors": "^2.8.5",
"cosmjs-types": "^0.8.0",
"create-hash": "^1.2.0",
"crisp-api": "^9.0.0",
Expand Down
3 changes: 3 additions & 0 deletions src/server/api/routes/bookstore/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { Router } = require('express');
const cors = require('cors');

const { IS_TESTNET } = require('../../../config/config');

Expand All @@ -11,6 +12,8 @@ const { handleRestfulError } = require('../../middleware/error');

const router = Router();

router.use('/bookstore', cors({ origin: true }));

router.get('/bookstore/tags', async (req, res, next) => {
try {
const { limit: pageSize, offset } = req.query;
Expand Down

0 comments on commit 6655649

Please sign in to comment.