Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow serving web interface from a subdirectory #22 #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mremallin
Copy link
Contributor

@mremallin mremallin commented Mar 16, 2020

This PR is to enable support for the following deployment model:

Today: https://photos.example.ca
PR: https://example.ca/photos

Summary of changes:

  • Added a new config variable at NPM build time to track the deployment folder: webroot_base_folder
    • Default is "/" to support the current deployment model
    • Supporting a sub-folder must specify the full path from root. Eg. "/photos/"
  • Update the NPM build to apply the above variable across the generated code/css/html
  • Added 001-config.js for a single place to store the generated config variable
  • Updated many link generators in the code to use the new get_webroot_folder() for paths
  • Moved index.html and loading.gif to be generated as part of the NPM build

Manual Testing:

  • Running serve.py for both "/" and "/photos/"
  • 1 level of subfolder
  • Forward and back in/out of fullscreen
  • Pasting the link from address bar into a new tab to load an image directly

EDIT: Updated URLs to example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant