mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
nuxt.config.js: more cleanup and additional proxies
This commit is contained in:
parent
99ffd3050c
commit
241c02be30
@ -1,6 +1,7 @@
|
|||||||
const pkg = require('./package.json')
|
const pkg = require('./package.json')
|
||||||
|
|
||||||
const routerBasePath = process.env.ROUTER_BASE_PATH || ''
|
const routerBasePath = process.env.ROUTER_BASE_PATH || ''
|
||||||
|
const serverHostUrl = process.env.NODE_ENV === 'production' ? '' : 'http://localhost:3333'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
||||||
@ -8,7 +9,7 @@ module.exports = {
|
|||||||
target: 'static',
|
target: 'static',
|
||||||
dev: process.env.NODE_ENV !== 'production',
|
dev: process.env.NODE_ENV !== 'production',
|
||||||
env: {
|
env: {
|
||||||
serverUrl: process.env.NODE_ENV === 'production' ? routerBasePath : 'http://localhost:3333',
|
serverUrl: serverHostUrl + routerBasePath,
|
||||||
chromecastReceiver: 'FD1F76C5'
|
chromecastReceiver: 'FD1F76C5'
|
||||||
},
|
},
|
||||||
telemetry: false,
|
telemetry: false,
|
||||||
@ -74,13 +75,15 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
proxy: {
|
proxy: {
|
||||||
[`${routerBasePath}/api/`]: { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' }
|
[`${routerBasePath}/api/`]: { target: process.env.NODE_ENV !== 'production' ? serverHostUrl : '/' },
|
||||||
|
[`${routerBasePath}/public/`]: { target: process.env.NODE_ENV !== 'production' ? serverHostUrl : '/' },
|
||||||
|
[`${routerBasePath}/hls/`]: { target: process.env.NODE_ENV !== 'production' ? serverHostUrl : '/' }
|
||||||
},
|
},
|
||||||
|
|
||||||
io: {
|
io: {
|
||||||
sockets: [{
|
sockets: [{
|
||||||
name: 'dev',
|
name: 'dev',
|
||||||
url: 'http://localhost:3333'
|
url: serverHostUrl
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'prod'
|
name: 'prod'
|
||||||
|
Loading…
Reference in New Issue
Block a user