mirror of
https://github.com/Xevion/time-banner.git
synced 2025-12-07 05:16:47 -06:00
Switch Tera template glob path prefix
This commit is contained in:
13
src/main.rs
13
src/main.rs
@@ -16,8 +16,12 @@ mod svg;
|
|||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref TEMPLATES: Tera = {
|
pub static ref TEMPLATES: Tera = {
|
||||||
let mut _tera = match Tera::new("./src/templates/**/*.svg") {
|
let mut _tera = match Tera::new("templates/**/*.svg") {
|
||||||
Ok(t) => t,
|
Ok(t) => {
|
||||||
|
let names: Vec<&str> = t.get_template_names().collect();
|
||||||
|
println!("{} templates found ([{}]).", names.len(), names.join(", "));
|
||||||
|
t
|
||||||
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Parsing error(s): {}", e);
|
println!("Parsing error(s): {}", e);
|
||||||
::std::process::exit(1);
|
::std::process::exit(1);
|
||||||
@@ -42,13 +46,8 @@ async fn main() {
|
|||||||
.with_max_level(config.log_level())
|
.with_max_level(config.log_level())
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
// build our application with a route
|
|
||||||
let app = Router::new().route("/", get(root_handler));
|
let app = Router::new().route("/", get(root_handler));
|
||||||
|
|
||||||
// run our app with hyper
|
|
||||||
// `axum::Server` is a re-export of `hyper::Server`
|
|
||||||
let addr = SocketAddr::from((config.socket_addr(), config.port));
|
let addr = SocketAddr::from((config.socket_addr(), config.port));
|
||||||
|
|
||||||
axum::Server::bind(&addr)
|
axum::Server::bind(&addr)
|
||||||
.serve(app.into_make_service_with_connect_info::<SocketAddr>())
|
.serve(app.into_make_service_with_connect_info::<SocketAddr>())
|
||||||
.await
|
.await
|
||||||
|
|||||||
Reference in New Issue
Block a user