mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-10 22:10:15 -05:00
[web] Fix running dev server with remote owntone server; update docs
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// Support for setting the OwnTone server URL as env var VITE_OWNTONE_URL
|
||||
// in development mode.
|
||||
// E. g. start the DEV server with
|
||||
//
|
||||
// VITE_OWNTONE_URL=https://owntone.local:3689 npm run serve
|
||||
//
|
||||
// will connect the web interface with a remote OwnTone server.
|
||||
const owntoneUrl = process.env.VITE_OWNTONE_URL ?? 'http://localhost:3689'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
resolve: { alias: { '@': '/src' } },
|
||||
@@ -18,13 +27,13 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3689'
|
||||
target: owntoneUrl
|
||||
},
|
||||
'/artwork': {
|
||||
target: 'http://localhost:3689'
|
||||
target: owntoneUrl
|
||||
},
|
||||
'/stream.mp3': {
|
||||
target: 'http://localhost:3689'
|
||||
target: owntoneUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user