Created
October 18, 2018 11:16
-
-
Save mitallast/9c5a8593f1576f0734b90a8f3f0a295d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "http-test" | |
version = "0.1.0" | |
authors = ["mitallast"] | |
[dependencies] | |
actix-web = "0.7" | |
futures = "0.1" | |
[profile.dev] | |
opt-level = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate actix_web; | |
use actix_web::{server, App, HttpRequest}; | |
use actix_web::{server::HttpServer, HttpResponse}; | |
fn index(_req: &HttpRequest) -> &'static str { | |
"Hello world!" | |
} | |
fn main() { | |
HttpServer::new(|| App::new().resource("/", |r| r.f(index))) | |
.workers(8) | |
.keep_alive(75) | |
.bind("127.0.0.1:8000") | |
.unwrap() | |
.run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment