Added web framework to the project

This commit is contained in:
Gonçalo Valério 2018-06-06 02:32:40 +01:00
parent 08d9c572d0
commit b335c6b0d4
3 changed files with 1624 additions and 2 deletions

1611
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -4,3 +4,4 @@ version = "0.1.0"
authors = ["Gonçalo Valério <gon@ovalerio.net>"]
[dependencies]
actix-web = "0.6.11"

View File

@ -1,3 +1,13 @@
fn main() {
println!("Hello, world!");
extern crate actix_web;
use actix_web::{server, App, HttpRequest};
fn index(_req: HttpRequest) -> &'static str {
"Hello world!"
}
fn main() {
server::new(|| App::new().resource("/", |r| r.f(index)))
.bind("127.0.0.1:8088")
.unwrap()
.run();
}