Stop relying on npm to have the UI static files available in the server #312
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #265
Depends on: trustification/trustify-ui#30
Problem
Currently we rely on NPM to be installed for the UI crate to build the UI static files. This introduces a new layer that developers on the backend side might have difficulties with.
Proposed solution
./static-local
to serve the UI../static-local
contains just a basic "welcome" HTML page../static
exists, then this directory will be used to serve the UI. We can populate this directory with the static files generated by trustify-ui (this process can be manual or we can set some automation on it)./static
decouples the build phase of the UI and Trustify.Steps to test this
To test the default behaviour (default UI, not trustify-ui):
cargo run --bin trustd
and then open http://localhost:8080. You should see only a welcome message.To test the UI from trustify-ui:
cargo clean
cargo run --bin trustd
and open http://localhost:8080 (open it in incognito mode to make sure cache is not there)