Migrate to actix-web #8

Manually merged
tlater merged 14 commits from tlater/actix-web into master 2022-09-16 17:44:53 +01:00
Showing only changes of commit 20a6291ac9 - Show all commits

View file

@ -60,6 +60,10 @@ async fn main() -> std::io::Result<()> {
HttpServer::new(move || { HttpServer::new(move || {
App::new() App::new()
.wrap(middleware::NormalizePath::trim()) .wrap(middleware::NormalizePath::trim())
// TODO(tlater): When actix-web 4.3 releases, this can be improved a
// lot because of this PR:
//
// https://github.com/actix/actix-web/pull/2784
.wrap( .wrap(
ErrorHandlers::new() ErrorHandlers::new()
.handler(StatusCode::NOT_FOUND, generic_error) .handler(StatusCode::NOT_FOUND, generic_error)