This commit is contained in:
Bruno Rybársky 2024-06-05 22:58:38 +02:00
commit e0520968aa
9 changed files with 2069 additions and 0 deletions

1
.gitignore vendored Normal file

@ -0,0 +1 @@
/target

5
.idea/.gitignore vendored Normal file

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

8
.idea/modules.xml Normal file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/siteinfo.iml" filepath="$PROJECT_DIR$/.idea/siteinfo.iml" />
</modules>
</component>
</project>

11
.idea/siteinfo.iml Normal file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="EMPTY_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

2003
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

8
Cargo.toml Normal file

@ -0,0 +1,8 @@
[package]
name = "siteinfo"
version = "0.1.0"
edition = "2021"
[dependencies]
rocket = { version = "0.5.1", features = ["json", "secrets"] }
rocket_dyn_templates = { version = "0.2.0", features = ["handlebars"] }

17
src/main.rs Normal file

@ -0,0 +1,17 @@
#[macro_use]
extern crate rocket;
use rocket_dyn_templates::{context, Template};
#[get("/")]
fn index() -> Template {
Template::render("index", context! {
kod: 123,
})
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![index])
.attach(Template::fairing())
}

10
templates/index.html.hbs Normal file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
<p>Kod je {{ kod }}</p>
</body>
</html>