mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-10 03:13:37 +02:00
init tera and html lsp
This commit is contained in:
@@ -4,6 +4,7 @@ use axum::{
|
||||
Extension, Router,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
use tera::Tera;
|
||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||
use zettle_db::{
|
||||
rabbitmq::{publisher::RabbitMQProducer, RabbitMQConfig},
|
||||
@@ -25,6 +26,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.try_init()
|
||||
.ok();
|
||||
|
||||
let tera = Tera::new("src/server/templates/**/*.html").unwrap();
|
||||
|
||||
// Set up RabbitMQ
|
||||
let config = RabbitMQConfig {
|
||||
amqp_addr: "amqp://localhost".to_string(),
|
||||
@@ -50,7 +53,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.route("/file/:uuid", put(update_file_handler))
|
||||
.route("/file/:uuid", delete(delete_file_handler))
|
||||
.route("/query", post(query_handler))
|
||||
.layer(Extension(db_client));
|
||||
.layer(Extension(db_client))
|
||||
.route(
|
||||
"/hello_world",
|
||||
get(zettle_db::server::routes::hello_world::hello_world_handler),
|
||||
)
|
||||
.layer(Extension(tera));
|
||||
|
||||
tracing::info!("Listening on 0.0.0.0:3000");
|
||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?;
|
||||
|
||||
Reference in New Issue
Block a user