# [Nuxt] Nuxt 3 - 跨域 CORS API ###### tags: `Nuxt` :::info * [Nuxt Configuration - vite](https://nuxt.com/docs/api/configuration/nuxt-config#vite "Nuxt Configuration Reference · Nuxt") * [Vite Server Options - proxy ](https://vitejs.dev/config/server-options.html#server-proxy "Server Options | Vite") ::: ```typescript // nuxt.config.ts export default defineNuxtConfig({ vite: { server: { proxy: { '/VsWeb/api': { // API 路由 target: 'https://www.vscinemas.com.tw/', // 主要 Domain changeOrigin: true, }, }, }, }, }); ``` ```javascript // .vue <script lang="ts" setup> const { data: list } = await useFetch('/VsWeb/api/GetLstDicCinema'); ``` --- :::info 建立日期:2023-08-28 更新日期:2023-09-08 :::
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up