feat(axum): expose hashed runtime asset path
Generate a SHA-256 content hash for the embedded hemx runtime, expose the hashed path from hemx-axum, serve immutable runtime headers, and update examples to load the hemx-owned path instead of fixed /hemx.js URLs. req: axum_integration/005
This commit is contained in:
@@ -5,7 +5,7 @@ use axum::routing::get;
|
||||
use axum::Router;
|
||||
use futures_util::stream;
|
||||
use hemx::IntoEffect;
|
||||
use hemx_axum::{runtime_js, sse, EffectResponse, InteractionRequest};
|
||||
use hemx_axum::{runtime_js, runtime_js_path, sse, EffectResponse, InteractionRequest};
|
||||
use hemx_saas_example::{home_page, live_status, registry, settings_page, ui, AppContext};
|
||||
use std::collections::BTreeMap;
|
||||
use std::convert::Infallible;
|
||||
@@ -26,7 +26,7 @@ fn app(ctx: AppContext) -> Router {
|
||||
.route("/", get(home).post(interact))
|
||||
.route("/settings", get(settings))
|
||||
.route("/events", get(events))
|
||||
.route("/hemx.js", get(runtime))
|
||||
.route(runtime_js_path(), get(runtime))
|
||||
.route("/app.css", get(css))
|
||||
.route("/metrics.js", get(metrics_js))
|
||||
.with_state(ctx)
|
||||
|
||||
Reference in New Issue
Block a user