Skip to content

Commit

Permalink
chore: configure api cors
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Oct 4, 2024
1 parent 19f545f commit e4e8ff8
Show file tree
Hide file tree
Showing 3 changed files with 639 additions and 379 deletions.
22 changes: 15 additions & 7 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default defineNuxtConfig({
'@nuxtjs/prismic',
'@nuxtjs/supabase',
'@nuxtjs/device',
'nuxt-security',
],

devtools: { enabled: true },
Expand Down Expand Up @@ -60,11 +61,6 @@ export default defineNuxtConfig({
fonts: ['Mulish:700'],
},

// TODO Remove this option
unocss: {
nuxtLayers: true,
},

pinia: {
storesDirs: ['./app/stores/**'],
},
Expand Down Expand Up @@ -135,10 +131,17 @@ export default defineNuxtConfig({
},
},

security: {
// https://nuxt-security.vercel.app/
corsHandler: { origin: ['nim.team', 'nimiq.com', 'nimiq.network'] },
},

routeRules: {
// Check ./modules/prerender-routes.ts to see more about this
// Check ./modules/prerender-routes.ts to learn more about routes

'/api/liveview/policy': { swr: 3600 }, // cache 1 hour
'/api/albatross/policy': {
swr: 3600, // cache 1 hour
},

'/privacy-policy': { redirect: 'https://www.iubenda.com/privacy-policy/78537710' },
'/cookie-policy': { redirect: 'https://www.iubenda.com/privacy-policy/78537710/cookie-policy' },
Expand Down Expand Up @@ -202,4 +205,9 @@ export default defineNuxtConfig({
sitemap: '/sitemap.xml',
},

// $development: {
// security: {
// corsHandler: { origin: '*' },
// },
// },
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"nimiq-css": "^0.2.3",
"nimiq-rpc-client-ts": "https://pkg.pr.new/onmax/albatross-rpc-client-ts/nimiq-rpc-client-ts@7618575",
"nuxt": "^3.13.2",
"nuxt-security": "^2.0.0",
"pinia": "^2.2.2",
"simple-git-hooks": "^2.11.1",
"slice-machine-ui": "^2.7.1",
Expand Down
Loading

0 comments on commit e4e8ff8

Please sign in to comment.