mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-06 03:49:40 +00:00
Fix ROUTER_BASE_PATH override for empty string
When the `ROUTER_BASE_PATH` env variable is set to an empty string it's mistakenly overriden to `/audiobookshelf` instead. The `/audiobookshelf` fallback should only be used when the `ROUTER_BASE_PATH` env variable is undefined, not just an empty string. Regression introduced in https://github.com/advplyr/audiobookshelf/pull/3810 See also: https://github.com/advplyr/audiobookshelf/pull/3810#discussion_r1948790937 Partially address https://github.com/advplyr/audiobookshelf/issues/3874
This commit is contained in:
parent
0ccb88904a
commit
14e92435ec
3 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
const pkg = require('./package.json')
|
||||
|
||||
const routerBasePath = process.env.ROUTER_BASE_PATH || '/audiobookshelf'
|
||||
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 : '/' }]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue