Serve in sub path

Official distributable files and docker images have been built so that they are served from the root of a domain.

If you need to host shlink-web-client yourself and serve it from a subpath, follow these steps:

  • Download shlink-web-client source code for the version you want to build.
  • Decompress the file and cd into the resulting folder.
  • Open the package.json file in the root of the project, locate the homepage property and replace the value (which should be an empty string) by the path from which you want to serve shlink-web-client.
    • For example: "homepage": "/my-projects/shlink-web-client".
  • Build the project:
    • For classic hosting:
      • Download node 16 or later.
      • Install project dependencies by running npm install.
      • Build the project by running npm run build.
      • Once the command finishes, you will have a build folder with all the static assets you need to run shlink-web-client. Just place them wherever you want them to be served from.
    • For docker image:
      • Download docker.
      • Build the docker image by running docker build . -t shlink-web-client.
      • Once the command finishes, you will have an image with the name shlink-web-client.