mirror of
https://github.com/actix/actix-website
synced 2025-06-27 15:39:02 +02:00
Test getting-started example
This commit is contained in:
18
examples/getting-started/src/main.rs
Normal file
18
examples/getting-started/src/main.rs
Normal 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>
|
Reference in New Issue
Block a user