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/package-lock.json b/src/package-lock.json index 1f5c10e09..565c78b81 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -29,6 +29,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", @@ -21746,6 +21747,18 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", diff --git a/src/package.json b/src/package.json index 6add93a5b..2152f01f5 100644 --- a/src/package.json +++ b/src/package.json @@ -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", 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;