#poem-web #poem #spa #web #web-framework #http

poem-spa

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

1 unstable release

0.9.1 Sep 22, 2022
0.9.0 Sep 22, 2022

#869 in HTTP server

MIT license

9KB
190 lines

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.

Dependencies

~14–26MB
~380K SLoC