added list (home) and details pages
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -5,7 +5,9 @@ use std::sync::Arc;
|
||||
use tera::Tera;
|
||||
|
||||
mod handlers;
|
||||
use handlers::{home_handler, showcase_handler};
|
||||
use handlers::home_handler;
|
||||
|
||||
use crate::handlers::report_details_handler;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref TEMPLATES: Tera = {
|
||||
@@ -14,7 +16,7 @@ lazy_static! {
|
||||
("_layout.html", include_str!("../templates/_layout.html")),
|
||||
("_base.css", include_str!("../templates/_base.css")),
|
||||
("index.html", include_str!("../templates/homepage.html")),
|
||||
("showcase.html", include_str!("../templates/showcase.html")),
|
||||
("details.html", include_str!("../templates/details.html")),
|
||||
])
|
||||
.unwrap();
|
||||
tera
|
||||
@@ -29,7 +31,7 @@ pub struct Cli {
|
||||
port: String,
|
||||
|
||||
/// Whether to listen on 0.0.0.0
|
||||
#[arg(short, long)]
|
||||
#[arg(long)]
|
||||
host: bool,
|
||||
|
||||
/// Verbose mode
|
||||
@@ -55,7 +57,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
|
||||
let app = Router::new()
|
||||
.route("/", get(home_handler))
|
||||
.route("/showcase", get(showcase_handler))
|
||||
.route("/report/{id}", get(report_details_handler))
|
||||
.with_state(shared_state);
|
||||
|
||||
let addr = if cli.host {
|
||||
|
||||
Reference in New Issue
Block a user