This extracts the main executable to cmd/riverui, and extracts the
handler code to a riverui.NewHandler() function so that it can be
embedded like any other http.Handler.
As part of doing this, changes were made on both the Go and JS side to
facilitate running the frontend within a path prefix. Right now this is
a bit messy to take advantage of because the JS frontend needs to be
configured or built with the base path like so:
This extracts the main executable to
cmd/riverui
, and extracts the handler code to ariverui.NewHandler()
function so that it can be embedded like any otherhttp.Handler
.As part of doing this, changes were made on both the Go and JS side to facilitate running the frontend within a path prefix. Right now this is a bit messy to take advantage of because the JS frontend needs to be configured or built with the base path like so:
Additionally
NewHandler()
needs to be provided with the base path so that it can be stripped from incoming requests to theServeMux
.The Dockerfile has also been reworked to make it easy to set a path prefix as well as a custom API route as desired.
Fixes https://github.com/riverqueue/riverui/issues/21.