Load index

This commit is contained in:
kieran 2024-04-30 22:38:14 +01:00
parent de275a27cb
commit 01fd419759
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 16 additions and 4 deletions

View File

@ -93,8 +93,12 @@ fn check_method(event: &nostr::Event, method: &str) -> bool {
} }
#[rocket::get("/")] #[rocket::get("/")]
async fn root() -> &'static str { async fn root() -> Result<NamedFile, Status> {
"Hello welcome to void_cat_rs" if let Ok(f) = NamedFile::open("./ui/index.html").await {
Ok(f)
} else {
Err(Status::InternalServerError)
}
} }
#[rocket::get("/<sha256>")] #[rocket::get("/<sha256>")]

View File

@ -2,9 +2,17 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Test Page</title> <title>void_cat_rs</title>
<style>
html {
background-color: black;
color: white;
}
</style>
</head> </head>
<body> <body>
<h1>
Welcome to void_cat_rs
</h1>
</body> </body>
</html> </html>