mirror of
https://codeberg.org/slatian/service.echoip-slatecave.git
synced 2025-07-17 06:23:29 +02:00
WIP moved templating engine to mycelium
This commit is contained in:
14
src/main.rs
14
src/main.rs
@ -44,7 +44,6 @@ mod mycelium;
|
||||
mod ratelimit;
|
||||
mod settings;
|
||||
mod simple_dns;
|
||||
mod templating_engine;
|
||||
mod view;
|
||||
|
||||
use crate::geoip::{
|
||||
@ -54,11 +53,14 @@ use crate::geoip::{
|
||||
LocationResult,
|
||||
};
|
||||
use crate::idna::IdnaName;
|
||||
use crate::mycelium::MycEngine;
|
||||
use crate::simple_dns::DnsLookupResult;
|
||||
use crate::settings::*;
|
||||
use crate::view::View;
|
||||
use crate::ipinfo::{AddressCast,AddressInfo,AddressScope};
|
||||
|
||||
type TemplatingEngine = MycEngine<View,QuerySettings,ResponseFormat>;
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone)]
|
||||
pub struct SettingsQuery {
|
||||
format: Option<ResponseFormat>,
|
||||
@ -95,7 +97,7 @@ pub struct DigResult {
|
||||
}
|
||||
|
||||
struct ServiceSharedState {
|
||||
templating_engine: templating_engine::Engine,
|
||||
templating_engine: TemplatingEngine,
|
||||
dns_resolvers: HashMap<Arc<str>,TokioAsyncResolver>,
|
||||
dns_resolver_aliases: HashMap<Arc<str>,Arc<str>>,
|
||||
asn_db: geoip::MMDBCarrier,
|
||||
@ -201,10 +203,10 @@ async fn main() {
|
||||
}
|
||||
};
|
||||
|
||||
let templating_engine = templating_engine::Engine{
|
||||
tera: tera,
|
||||
template_config: template_extra_config,
|
||||
};
|
||||
let templating_engine = TemplatingEngine::new(
|
||||
tera,
|
||||
template_extra_config,
|
||||
);
|
||||
|
||||
// Static file directory
|
||||
|
||||
|
Reference in New Issue
Block a user