mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-14 12:10:18 +03:00
chore(dev): Better support reverse proxy in dev mode (#1974)
This commit is contained in:
parent
baf79612fd
commit
76fb79ee69
2 changed files with 8 additions and 11 deletions
|
@ -1,8 +1,5 @@
|
|||
VITE_QBITTORRENT_TARGET='http://localhost'
|
||||
VITE_QBITTORRENT_PORT=8080
|
||||
|
||||
VITE_BACKEND_TARGET='http://localhost'
|
||||
VITE_BACKEND_PORT=8081
|
||||
VITE_QBITTORRENT_TARGET=http://localhost:8080
|
||||
VITE_BACKEND_TARGET=http://localhost:8081
|
||||
|
||||
VITE_USE_MOCK_PROVIDER=false
|
||||
VITE_FAKE_TORRENTS_COUNT=5
|
||||
|
|
|
@ -9,10 +9,8 @@ import vuetify from 'vite-plugin-vuetify'
|
|||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
const qBittorrentHost = env.VITE_QBITTORRENT_TARGET ?? 'http://127.0.0.1'
|
||||
const qBittorrentPort = env.VITE_QBITTORRENT_PORT ?? '8080'
|
||||
const backendHost = env.VITE_BACKEND_HOST ?? 'http://127.0.0.1'
|
||||
const backendPort = env.VITE_BACKEND_PORT ?? '3000'
|
||||
const qBittorrentTarget = env.VITE_QBITTORRENT_TARGET ?? 'http://localhost:8080'
|
||||
const backendTarget = env.VITE_BACKEND_TARGET ?? 'http://localhost:3000'
|
||||
|
||||
return {
|
||||
base: './',
|
||||
|
@ -53,11 +51,13 @@ export default defineConfig(({ mode }) => {
|
|||
proxy: {
|
||||
'/api': {
|
||||
secure: false,
|
||||
target: `${qBittorrentHost}:${qBittorrentPort}`
|
||||
changeOrigin: true,
|
||||
target: qBittorrentTarget
|
||||
},
|
||||
'/backend': {
|
||||
secure: false,
|
||||
target: `${backendHost}:${backendPort}`
|
||||
changeOrigin: true,
|
||||
target: backendTarget
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue