aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-02-08 21:40:01 -0800
committerPinapelz <yukais@pinapelz.com>2025-02-08 21:40:01 -0800
commit4c41076570073e8b960742b6e1c2231fecfa6cce (patch)
treed9c0412334eaf963bf9bcb32f019c1303a1e478c /src/main.rs
parentda16c5147e37165e420a5205adc46dcfe66baa17 (diff)
remove rust portion as its no longer necessary
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index 877b86d..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-use actix_files as fs;
-use actix_web::{web, App, HttpResponse, HttpServer, Result};
-use tera::Tera;
-
-async fn index(templates: web::Data<Tera>) -> Result<HttpResponse> {
- let mut context = tera::Context::new();
- context.insert("name", "World");
-
- let rendered = templates
- .render("index.html", &context)
- .map_err(|e| {
- eprintln!("Template rendering error: {}", e);
- actix_web::error::ErrorInternalServerError("Template rendering error")
- })?;
-
- Ok(HttpResponse::Ok().content_type("text/html").body(rendered))
-}
-
-#[actix_web::main]
-async fn main() -> std::io::Result<()> {
- let tera = Tera::new("templates/**/*").expect("Error initializing Tera");
-
- HttpServer::new(move || {
- App::new()
- .app_data(web::Data::new(tera.clone()))
- .route("/", web::get().to(index))
- .service(fs::Files::new("/static", "./static").show_files_listing())
- })
- .bind("127.0.0.1:8080")?
- .run()
- .await
-}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage