feat: add CORS support for API and update .gitignore and configuration documentation
This commit is contained in:
parent
225579ba68
commit
aa8ebca8f6
3 changed files with 8 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -27,3 +27,4 @@ site
|
||||||
cache
|
cache
|
||||||
public/world.json
|
public/world.json
|
||||||
.dev.*
|
.dev.*
|
||||||
|
.kiro/steering/locale.md
|
||||||
|
|
|
||||||
|
|
@ -61,3 +61,7 @@ Set the maximum query data volume for the Metric list.
|
||||||
## `NUXT_DISABLE_BOT_ACCESS_LOG`
|
## `NUXT_DISABLE_BOT_ACCESS_LOG`
|
||||||
|
|
||||||
Access statistics do not count bot traffic.
|
Access statistics do not count bot traffic.
|
||||||
|
|
||||||
|
## `NUXT_API_CORS`
|
||||||
|
|
||||||
|
Set the environment variable `NUXT_API_CORS=true` during build to enable CORS support for the API.
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ export default defineNuxtConfig({
|
||||||
'/dashboard': {
|
'/dashboard': {
|
||||||
redirect: '/dashboard/links',
|
redirect: '/dashboard/links',
|
||||||
},
|
},
|
||||||
|
'/api/**': {
|
||||||
|
cors: process.env.NUXT_API_CORS === 'true',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
future: {
|
future: {
|
||||||
|
|
@ -60,10 +63,6 @@ export default defineNuxtConfig({
|
||||||
enforceModuleCompatibility: true,
|
enforceModuleCompatibility: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
compatibilityDate: {
|
|
||||||
cloudflare: '2025-05-08',
|
|
||||||
},
|
|
||||||
|
|
||||||
nitro: {
|
nitro: {
|
||||||
experimental: {
|
experimental: {
|
||||||
openAPI: true,
|
openAPI: true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue