Skip to content

Instantly share code, notes, and snippets.

@mitallast
Created October 18, 2018 11:16
Show Gist options
  • Save mitallast/9c5a8593f1576f0734b90a8f3f0a295d to your computer and use it in GitHub Desktop.
Save mitallast/9c5a8593f1576f0734b90a8f3f0a295d to your computer and use it in GitHub Desktop.
[package]
name = "http-test"
version = "0.1.0"
authors = ["mitallast"]
[dependencies]
actix-web = "0.7"
futures = "0.1"
[profile.dev]
opt-level = 3
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