1
0
mirror of https://github.com/actix/examples synced 2025-06-26 09:17:41 +02:00

upgrade example to actix-web 0.7

This commit is contained in:
Nikolay Kim
2018-07-16 12:36:53 +06:00
parent 0b52c7850e
commit 2cc1b23761
57 changed files with 913 additions and 693 deletions

View File

@ -6,6 +6,8 @@ workspace = "../"
[dependencies]
env_logger = "0.5"
actix = "0.5"
actix-web = "^0.6"
tokio-uds = "0.1"
tokio-uds = "0.2"
actix = "0.7"
#actix-web = "^0.7"
actix-web = { git = "https://github.com/actix/actix-web.git" }

View File

@ -7,7 +7,7 @@ use actix::*;
use actix_web::{middleware, server, App, HttpRequest};
use tokio_uds::UnixListener;
fn index(_req: HttpRequest) -> &'static str {
fn index(_req: &HttpRequest) -> &'static str {
"Hello world!"
}
@ -16,8 +16,7 @@ fn main() {
env_logger::init();
let sys = actix::System::new("unix-socket");
let listener = UnixListener::bind("/tmp/actix-uds.socket", Arbiter::handle())
.expect("bind failed");
let listener = UnixListener::bind("/tmp/actix-uds.socket").expect("bind failed");
server::new(|| {
App::new()
// enable logger