Added web framework to the project
This commit is contained in:
parent
08d9c572d0
commit
b335c6b0d4
File diff suppressed because it is too large
Load Diff
|
@ -4,3 +4,4 @@ version = "0.1.0"
|
|||
authors = ["Gonçalo Valério <gon@ovalerio.net>"]
|
||||
|
||||
[dependencies]
|
||||
actix-web = "0.6.11"
|
14
src/main.rs
14
src/main.rs
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue