jwplayer / ott-web-app

Reference implementation for JWP-powered apps
Apache License 2.0
70 stars 52 forks source link

Subdirectory #452

Closed anoblet closed 6 months ago

anoblet commented 8 months ago

Is it possible to install the app in a subdirectory?

ChristiaanScheermeijer commented 7 months ago

Hi @anoblet, you can configure Vite to serve the app from a sub-directory using the base property. This will work with the build command as well.

    /**
     * Base public path when served in development or production.
     * @default '/'
     */
    base?: string;

You can add the property here: https://github.com/jwplayer/ott-web-app/blob/3e3e2b14c4926e596fad46c2ea7cc99dbced05f0/platforms/web/vite.config.ts#L88-L93

However, you might want to disable the service worker or ensure that the scope and start_url match the subdirectory, otherwise, the service worker will be installed for the root domain.

anoblet commented 6 months ago

Thank you!