mirror of
https://github.com/actix/actix-web.git
synced 2025-02-17 03:25:15 +00:00
15 lines
320 B
Rust
15 lines
320 B
Rust
use actix_web::*;
|
|
|
|
#[route("/")]
|
|
async fn index() -> impl Responder {
|
|
HttpResponse::Ok()
|
|
}
|
|
|
|
#[actix_web::main]
|
|
async fn main() {
|
|
let srv = test::start(|| App::new().service(index));
|
|
|
|
let request = srv.get("/");
|
|
let response = request.send().await.unwrap();
|
|
assert!(response.status().is_success());
|
|
}
|