mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
upgrade to alpha.6
This commit is contained in:
@ -12,7 +12,6 @@
|
||||
// - POSTing json body
|
||||
// 3. chaining futures into a single response used by an asynch endpoint
|
||||
|
||||
|
||||
#[macro_use]
|
||||
extern crate validator_derive;
|
||||
#[macro_use]
|
||||
@ -47,8 +46,6 @@ struct HttpBinResponse {
|
||||
url: String,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// post json to httpbin, get it back in the response body, return deserialized
|
||||
fn step_x(
|
||||
data: SomeData,
|
||||
@ -93,12 +90,9 @@ fn main() -> io::Result<()> {
|
||||
|
||||
println!("Starting server at: {:?}", endpoint);
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.data(Client::default())
|
||||
.service(
|
||||
web::resource("/something")
|
||||
.route(web::post().to_async(create_something)),
|
||||
)
|
||||
App::new().data(Client::default()).service(
|
||||
web::resource("/something").route(web::post().to_async(create_something)),
|
||||
)
|
||||
})
|
||||
.bind(endpoint)?
|
||||
.run()
|
||||
|
Reference in New Issue
Block a user