spa-rs
spa-rs is a library who can embed all SPA web application files (dist static file), and release as a single binary executable.
It based-on [axum] and [rust_embed]
It reexported all axum module for convenient use.
Example
use spa_server_root;
use SpaServer;
use ;
use Result;
spa_server_root!; // specific your SPA dist file location
async
Session
See [session] module for more detail.
Dev
When writing SPA application, you may want use hot-reload functionallity provided
by SPA framework. such as [vite dev] or [ng serve].
You can use spa-rs to reverse proxy all static requests to SPA framework. (need enable reverse-proxy feature)
Example
let forward_addr = "http://localhost:1234";
srv.reverse_proxy;
License: MIT