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:
@ -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" }
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user