1.3 KiB
Migrating to 2.0.0
-
HttpServer::start()renamed toHttpServer::run(). It also possible to.awaitonrunmethod result, in that case it awaits server exit. -
App::register_data()renamed toApp::app_data()and accepts any typeT: 'static. Stored data is available viaHttpRequest::app_data()method at runtime. -
Extractor configuration must be registered with
App::app_data()instead ofApp::data() -
Sync handlers has been removed.
.to_async()method has been renamed to.to()replacefnwithasync fnto convert sync handler to async -
actix_http_test::TestServermoved toactix_web::testmodule. To start test server usetest::start()ortest_start_with_config()methods -
ResponseErrortrait has been refactored.ResponseError::error_response()renders http response. -
Feature
rust-tlsrenamed torustlsinstead of
actix-web = { version = "2.0.0", features = ["rust-tls"] }use
actix-web = { version = "2.0.0", features = ["rustls"] } -
Feature
sslrenamed toopensslinstead of
actix-web = { version = "2.0.0", features = ["ssl"] }use
actix-web = { version = "2.0.0", features = ["openssl"] } -
Corsbuilder now requires that you call.finish()to construct the middleware