feat(workflow): example stats page with embedded Chart.js, inline form validation errors
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
-11
@@ -1,19 +1,22 @@
|
||||
#include "App.hpp"
|
||||
|
||||
#include "gen/assets.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
namespace {
|
||||
|
||||
// Byte-identical reproducible bundle. Production bundles are generated by
|
||||
// the asset embedder CLI (09-cli-ops.md); this hand-written copy proves the
|
||||
// serving path with sorted names and no timestamps.
|
||||
|
||||
} // namespace
|
||||
|
||||
// The bundle is generated at build time from example/assets by the MoloApp
|
||||
// embedder (see example/example.mk, target example-assets). Names are
|
||||
// sorted and byte-identical across runs.
|
||||
void load_embedded(Services& services) {
|
||||
services.embedded["/app.css"] =
|
||||
"/* embedded bundle */\nbody{font-family:sans-serif}\n";
|
||||
services.embedded["/hello.txt"] = "hello from embedded assets\n";
|
||||
const gen::EmbeddedFile* files = gen::bundle_files();
|
||||
for (unsigned long i = 0; i < gen::bundle_count(); ++i) {
|
||||
std::string body;
|
||||
body.reserve(files[i].size);
|
||||
for (unsigned long c = 0; c < files[i].chunk_count; ++c)
|
||||
body.append(reinterpret_cast<const char*>(files[i].chunks[c].data),
|
||||
files[i].chunks[c].size);
|
||||
services.embedded["/" + std::string(files[i].path)] = std::move(body);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
|
||||
Reference in New Issue
Block a user