Initial commit
This commit is contained in:
48
admin/vite.config.ts
Normal file
48
admin/vite.config.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8000',
|
||||
changeOrigin: true,
|
||||
configure: (proxy) => {
|
||||
proxy.on('proxyRes', (proxyRes) => {
|
||||
const setCookie = proxyRes.headers['set-cookie']
|
||||
if (setCookie) {
|
||||
const rewritten = (Array.isArray(setCookie) ? setCookie : [setCookie]).map(
|
||||
(cookie: string) =>
|
||||
cookie
|
||||
.replace(/;\s*[Dd]omain=[^;]+/g, '; Domain=localhost')
|
||||
.replace(/;\s*[Ss]ecure\b/g, ''),
|
||||
)
|
||||
proxyRes.headers['set-cookie'] = rewritten
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
'/sanctum': {
|
||||
target: 'http://localhost:8000',
|
||||
changeOrigin: true,
|
||||
configure: (proxy) => {
|
||||
proxy.on('proxyRes', (proxyRes) => {
|
||||
const setCookie = proxyRes.headers['set-cookie']
|
||||
if (setCookie) {
|
||||
const rewritten = (Array.isArray(setCookie) ? setCookie : [setCookie]).map(
|
||||
(cookie: string) =>
|
||||
cookie
|
||||
.replace(/;\s*[Dd]omain=[^;]+/g, '; Domain=localhost')
|
||||
.replace(/;\s*[Ss]ecure\b/g, ''),
|
||||
)
|
||||
proxyRes.headers['set-cookie'] = rewritten
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user