Enable subdirectory support

This commit is contained in:
mikiher 2025-01-09 07:41:09 +02:00
parent 02ecf7ccfe
commit 9668b49df9
3 changed files with 3 additions and 3 deletions

View file

@ -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 : '/' }]))