1
0
mirror of https://github.com/actix/actix-website synced 2025-06-27 07:29:02 +02:00

Test getting-started example

This commit is contained in:
Armin Ronacher
2018-05-23 23:25:51 +02:00
parent b7025c029f
commit ab91b27c13
4 changed files with 27 additions and 18 deletions

View File

@ -0,0 +1,6 @@
[package]
name = "getting-started"
version = "0.1.0"
[dependencies]
actix-web = "0.6"

View File

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