GoogleCloudPlatform/spanner-migration-tool

Remove dependence of HarbourBridge UI on static assets

manitgupta opened this issue · 1 comments

Expected Behavior

HarbourBridge should be deployable to customers as a binary without needing additional configuration files or static assets which need to be distributed outside of the binary.

Actual Behavior

The web UI currently depends on static assets whose relative paths are specified in the code. Due to this it can only be run when the binary is placed alongside (in the same directory) as the source code. The static assets that are used for rendering the web UI are not packaged with the binary

Steps to Reproduce the Problem

  1. Build HB binary go build
  2. Run harbourbridge from any path other than the directory in which the binary is present OR copy the binary to any other directory.
  3. Run the UI using the --web flag.
  4. localhost:8080 displays a 404 page not found error.

Sample ref on how to embed static assets -
https://harsimranmaan.medium.com/embedding-static-files-in-a-go-binary-using-go-embed-bac505f3cb9a

Fixed in #320