Files
moloapp/example/fw/StaticFiles.hpp
T
retoor 3c4334cec9 feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security,
data, app, realtime, supervisor, clients, CLI, example plus
enterprise tenancy, audit, operability, governance,
supplychain. Postgres via docker compose for tests.
2026-10-23 18:20:04 +02:00

25 lines
723 B
C++

#pragma once
// Static file serving from disk or from embedded C++ assets, with path
// traversal protection, ETags, and cache-control headers.
// Gap: real static serving in 01-runtime.md owns ranges, conditional
// requests, and directory indexing; the embedder CLI lives in 09-cli-ops.md.
#include <map>
#include <string>
#include "Http.hpp"
namespace molo::example::fw {
bool path_is_safe(const std::string& request_path);
Response serve_disk_file(const std::string& root, const std::string& subpath);
Response serve_embedded(const std::map<std::string, std::string>& assets,
const std::string& subpath);
std::string etag_for(const std::string& body);
} // namespace molo::example::fw