actix-web static files as resources support
Legal
Dual-licensed under MIT
or the UNLICENSE.
Features
- Embed static resources in end binary
- Serve static resources as directory in
actix-web
Usage
Create folder with static resources in your project (for example static
):
Add to Cargo.toml
dependency to actix-web-static-files
:
[]
= "0.1"
[]
= "0.1"
Add build script to Cargo.toml
:
[]
= "build.rs"
Add build.rs
with call to bundle resources:
use resource_dir;
Include generated code in main.rs
:
use ;
use actix_web_static_files;
use HashMap;
include!;
Run the server:
Request the resource:
> GET
> Host:
> User-Agent:
> Accept:
>
< HTTP/1.1
< content-length:
< date:
<
) )