diff --git a/functions/package-lock.json b/functions/package-lock.json index cc4053306..0858d6a55 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -29,6 +29,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", diff --git a/functions/package.json b/functions/package.json index 7063feee6..134e0630d 100644 --- a/functions/package.json +++ b/functions/package.json @@ -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", diff --git a/src/server/api/routes/bookstore/index.js b/src/server/api/routes/bookstore/index.js index e74cf5904..639bb417e 100644 --- a/src/server/api/routes/bookstore/index.js +++ b/src/server/api/routes/bookstore/index.js @@ -1,4 +1,5 @@ const { Router } = require('express'); +const cors = require('cors'); const { IS_TESTNET } = require('../../../config/config'); @@ -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;