-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kirkbyers
committed
Mar 31, 2024
1 parent
7b00ca1
commit 1062281
Showing
6 changed files
with
311 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use actix_web::{get, HttpResponse}; | ||
use tera::{Context, Tera}; | ||
|
||
#[get("/")] | ||
async fn home() -> HttpResponse { | ||
let tera_context = Context::new(); | ||
let rendered = match Tera::one_off(include_str!("../templates/index.html"), &tera_context, true) | ||
{ | ||
Ok(rendered) => rendered, | ||
Err(e) => { | ||
eprintln!("Failed to render template: {:?}", e); | ||
return HttpResponse::InternalServerError().finish(); | ||
} | ||
}; | ||
HttpResponse::Ok().body(rendered) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
mod green_recs; | ||
mod health_check; | ||
mod index; | ||
mod scrapes; | ||
mod subscriptions; | ||
|
||
pub use green_recs::*; | ||
pub use health_check::*; | ||
pub use index::*; | ||
pub use scrapes::*; | ||
pub use subscriptions::*; |
Oops, something went wrong.