From 9668b49df95454f19081942e7481afd7451a14e4 Mon Sep 17 00:00:00 2001 From: mikiher Date: Thu, 9 Jan 2025 07:41:09 +0200 Subject: [PATCH] Enable subdirectory support --- client/nuxt.config.js | 2 +- index.js | 2 +- prod.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/nuxt.config.js b/client/nuxt.config.js index c687f40098..bb5954778b 100644 --- a/client/nuxt.config.js +++ b/client/nuxt.config.js @@ -1,6 +1,6 @@ const pkg = require('./package.json') -const routerBasePath = process.env.ROUTER_BASE_PATH || '' +const routerBasePath = process.env.ROUTER_BASE_PATH || '/audiobookshelf' const serverHostUrl = process.env.NODE_ENV === 'production' ? '' : 'http://localhost:3333' const serverPaths = ['api/', 'public/', 'hls/', 'auth/', 'feed/', 'status', 'login', 'logout', 'init'] const proxy = Object.fromEntries(serverPaths.map((path) => [`${routerBasePath}/${path}`, { target: process.env.NODE_ENV !== 'production' ? serverHostUrl : '/' }])) diff --git a/index.js b/index.js index 4b3a2648bd..35dcc5885a 100644 --- a/index.js +++ b/index.js @@ -41,7 +41,7 @@ const CONFIG_PATH = inputConfig || process.env.CONFIG_PATH || Path.resolve('conf const METADATA_PATH = inputMetadata || process.env.METADATA_PATH || Path.resolve('metadata') const SOURCE = options.source || process.env.SOURCE || 'debian' -const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || '' +const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || '/audiobookshelf' console.log(`Running in ${process.env.NODE_ENV} mode.`) console.log(`Options: CONFIG_PATH=${CONFIG_PATH}, METADATA_PATH=${METADATA_PATH}, PORT=${PORT}, HOST=${HOST}, SOURCE=${SOURCE}, ROUTER_BASE_PATH=${ROUTER_BASE_PATH}`) diff --git a/prod.js b/prod.js index 70633d5b23..24a0c3f783 100644 --- a/prod.js +++ b/prod.js @@ -25,7 +25,7 @@ const CONFIG_PATH = inputConfig || process.env.CONFIG_PATH || Path.resolve('conf const METADATA_PATH = inputMetadata || process.env.METADATA_PATH || Path.resolve('metadata') const SOURCE = options.source || process.env.SOURCE || 'debian' -const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || '' +const ROUTER_BASE_PATH = process.env.ROUTER_BASE_PATH || '/audiobookshelf' console.log(process.env.NODE_ENV, 'Config', CONFIG_PATH, METADATA_PATH)