1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00
This commit is contained in:
Rob Ede
2022-02-18 02:44:02 +00:00
parent aca1dab890
commit fbd3b228e9
48 changed files with 103 additions and 261 deletions

View File

@ -7,9 +7,7 @@ use rustls_pemfile::{certs, pkcs8_private_keys};
#[get("/")]
async fn index() -> String {
String::from(
"<html><head><title>FOO BAR</title></head><body><h1>FOO BAR</h1></body></html>",
)
String::from("<html><head><title>FOO BAR</title></head><body><h1>FOO BAR</h1></body></html>")
}
#[actix_web::main]

View File

@ -32,9 +32,11 @@ async fn main() -> std::io::Result<()> {
.service(web::resource("/login").to(|| async {
"You are on /login. Go to src/redirect.rs to change this behavior."
}))
.service(web::resource("/").to(|| async {
"Hello, middleware! Check the console where the server is run."
}))
.service(
web::resource("/").to(|| async {
"Hello, middleware! Check the console where the server is run."
}),
)
})
.bind(("127.0.0.1", 8080))?
.run()