Remove dependence of HarbourBridge UI on static assets
manitgupta opened this issue · 1 comments
manitgupta commented
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
- Build HB binary
go build
- Run
harbourbridge
from any path other than the directory in which the binary is present OR copy the binary to any other directory. - Run the UI using the
--web
flag. localhost:8080
displays a404 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
manitgupta commented
Fixed in #320