1.3 KiB
Migrating to 2.0.0
-
HttpServer::start()
renamed toHttpServer::run()
. It also possible to.await
onrun
method 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()
replacefn
withasync fn
to convert sync handler to async -
actix_http_test::TestServer
moved toactix_web::test
module. To start test server usetest::start()
ortest_start_with_config()
methods -
ResponseError
trait has been refactored.ResponseError::error_response()
renders http response. -
Feature
rust-tls
renamed torustls
instead of
actix-web = { version = "2.0.0", features = ["rust-tls"] }
use
actix-web = { version = "2.0.0", features = ["rustls"] }
-
Feature
ssl
renamed toopenssl
instead of
actix-web = { version = "2.0.0", features = ["ssl"] }
use
actix-web = { version = "2.0.0", features = ["openssl"] }
-
Cors
builder now requires that you call.finish()
to construct the middleware