|
Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
|
Options for static_files(). More...
#include <StaticFiles.hpp>
Public Attributes | |
| std::string | index = "index.html" |
| File served for a request that names a directory; empty disables it. | |
| bool | serve_dotfiles = false |
| Serve files and directories whose name starts with '.' (.env, .git/). | |
| std::chrono::seconds | max_age {0} |
| std::string | mount |
| bool | fallthrough = true |
| bool | precompressed = false |
Options for static_files().
| bool orbit::middleware::StaticFilesOptions::fallthrough = true |
When no file matches, continue to the next middleware and the routes (true), or answer 404 here (false), which suits a mounted directory whose prefix no route shares.
| std::string orbit::middleware::StaticFilesOptions::index = "index.html" |
File served for a request that names a directory; empty disables it.
| std::chrono::seconds orbit::middleware::StaticFilesOptions::max_age {0} |
Cache-Control max-age. Zero sends "no-cache": browsers revalidate with the ETag / Last-Modified on every use.
| std::string orbit::middleware::StaticFilesOptions::mount |
URL prefix to serve the directory under, e.g. "/files": only requests below it are considered, and the prefix is stripped before the path is resolved (/files/a.png -> <directory>/a.png). Empty serves the directory at the site root.
| bool orbit::middleware::StaticFilesOptions::precompressed = false |
Serve a precompressed sibling when the client accepts its coding: app.js.br, app.js.zst or app.js.gz for app.js, with Content-Encoding, the original's Content-Type and Vary: Accept-Encoding. The plain file is served otherwise, and must exist.
| bool orbit::middleware::StaticFilesOptions::serve_dotfiles = false |
Serve files and directories whose name starts with '.' (.env, .git/).