File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import helmet from 'helmet'
44// @ts -expect-error no types shipped with tileserver-gl-light
55import { server as tileserverGl } from 'tileserver-gl-light/src/server.js'
66import log from '#log'
7+ import config from '#config'
78import { buildTileserverConfig } from './build-config.ts'
89
910interface TileserverRunning {
@@ -22,7 +23,8 @@ export const createApp = async (): Promise<Express> => {
2223 const running = await ( tileserverGl ( {
2324 config : tileserverConfig ,
2425 port : 0 ,
25- silent : true
26+ silent : true ,
27+ publicUrl : config . publicUrl
2628 } ) as Promise < TileserverRunning > )
2729 await running . startupPromise
2830 await new Promise < void > ( ( resolve , reject ) => {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const EnvSchema = z.object({
1616 STYLE_INCLUDE : z . string ( ) . default ( '' ) . transform ( parseList ) ,
1717 STYLE_EXCLUDE : z . string ( ) . default ( '' ) . transform ( parseList ) ,
1818 STYLE_ALIASES : z . string ( ) . default ( '' ) . transform ( parseAliases ) ,
19+ PUBLIC_URL : z . string ( ) . default ( '/tileserver/' )
1920} )
2021
2122const parsed = EnvSchema . safeParse ( process . env )
@@ -46,6 +47,7 @@ const config = {
4647 styleInclude : env . STYLE_INCLUDE ,
4748 styleExclude : env . STYLE_EXCLUDE ,
4849 styleAliases : env . STYLE_ALIASES ,
50+ publicUrl : env . PUBLIC_URL
4951} as const
5052
5153export default config
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ const globalSetup = async (): Promise<void> => {
107107 PORT : String ( tileserverPort ) ,
108108 DATA_DIR : dataDir ,
109109 FONTS_DIR : fontsDir ,
110+ PUBLIC_URL : '/' ,
110111 OBSERVER_ACTIVE : 'false' ,
111112 LOG_LEVEL : 'info' ,
112113 NODE_ENV : 'test'
You can’t perform that action at this time.
0 commit comments