poem-spa

Crates.iopoem-spa
lib.rspoem-spa
version0.9.1
sourcesrc
created_at2022-09-22 19:38:26.456071
updated_at2022-09-22 19:43:43.609634
descriptionThis crate provides an Endpoint for poem web framework that serves an SPA from static files.
homepage
repositoryhttps://github.com/bdew/poem-spa
max_upload_size
id671961
size8,273
(bdew)

documentation

README

poem-spa

This crate provides an Endpoint for poem web framework that serves an SPA from static files.

Unlike StaticFilesEndpoint this endpoint will serve an index file for all paths that don't match an actual file.

Assets folders can be defined that will return 404 response for any requests that don't match files inside them.

Example

Route::new()
	.nest("/",
		SPAEndpoint::new("./site", "index.html")
		.with_assets("static")
	)

License

This code is licensed under the MIT License.

Commit count: 2

cargo fmt