mirror of
https://github.com/actix/actix-website
synced 2025-06-29 16:24:58 +02:00
Added basic example with includes
This commit is contained in:
15
examples/application/src/main.rs
Normal file
15
examples/application/src/main.rs
Normal file
@ -0,0 +1,15 @@
|
||||
extern crate actix_web;
|
||||
use actix_web::{App, Responder, HttpRequest, http::Method};
|
||||
|
||||
// <setup>
|
||||
fn index(req: HttpRequest) -> impl Responder {
|
||||
"Hello world!"
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let app = App::new()
|
||||
.prefix("/app")
|
||||
.resource("/index.html", |r| r.method(Method::GET).f(index))
|
||||
.finish();
|
||||
}
|
||||
// </setup>
|
Reference in New Issue
Block a user