Expand description
This crate provides a tower service designed to provide embedded static
assets support for web application. This service includes the following HTTP features:
- Support for GET and HEAD requests
Content-Typeheader generation based on file MIME type guessed from extension.ETagheader generation and validation.Last-Modifiedheader generation and validation.
In debug mode, assets are served directly from the filesystem to facilitate rapid
development. Both ETag and Last-Modified headers are not generated in this mode.
§Usage
Please see the examples directory for a working example.
Modules§
- core
- Core functionalities of tower-embed.
Structs§
- Response
Body - The body used in crate responses.
- Response
Future - Response future of
ServeEmbed - Serve
Embed - Service that serves files from embedded assets.
Traits§
- Embed
- A trait used to access to binary assets in a directory.
Derive Macros§
- Embed
- Derive the
Embedtrait for unit struct, embedding assets from a folder.