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

migrate to docusaurus (v2) (#266)

Co-authored-by: ibraheemdev <ibrah1440@gmail.com>
This commit is contained in:
Santiago
2022-07-16 11:59:20 +02:00
committed by GitHub
parent a85b4ff5a3
commit 8393aea71a
85 changed files with 23020 additions and 4357 deletions

View File

@ -1,6 +1,7 @@
// <request-routing>
use actix_web::{web, App, HttpRequest, HttpServer, Responder};
use actix_web::{get, web, App, HttpRequest, HttpServer, Responder};
#[get("/")]
async fn index(_req: HttpRequest) -> impl Responder {
"Hello from the index page."
}
@ -13,8 +14,8 @@ async fn hello(path: web::Path<String>) -> impl Responder {
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.service(web::resource("/").to(index))
.service(web::resource("/{name}").to(hello))
.service(index)
.route("/{name}", web::get().to(hello))
})
.bind(("127.0.0.1", 8080))?
.run()