Initial commit

This commit is contained in:
hodasemi 2023-08-28 12:45:44 +02:00
commit 207c542f0a
4 changed files with 38 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/target
Cargo.lock

10
Cargo.toml Normal file
View file

@ -0,0 +1,10 @@
[package]
name = "petersilie_server"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = { version = "=0.5.0-rc.3", features = ["secrets", "json"] }
rocket_dyn_templates = { version = "=0.1.0-rc.3", features = ["tera"] }

12
resources/index.html Normal file
View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Basic Web Page</title>
</head>
<body>
Hello World!
</body>
</html>

14
src/main.rs Normal file
View file

@ -0,0 +1,14 @@
#[macro_use]
extern crate rocket;
use rocket::fs::NamedFile;
#[get("/")]
async fn index() -> Option<NamedFile> {
NamedFile::open("resources/index.html").await.ok()
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index])
}