Skip to content

Commit

Permalink
chore(readme): add public crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmard committed Jul 24, 2024
1 parent bbd42f5 commit ec6b747
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[package]
name = "medullah-web"
version = "0.4.0"
version = "0.4.1"
edition = "2021"
license = "MIT"
description = "Micro-Framework Base on Ntex"
repository = "https://github.com/spiralover/medullah-web"

publish = ["spiralindex"]
publish = ["spiral", "crates-io"]

[features]
default = ["feat-mailer", "r2d2"]
Expand Down
9 changes: 7 additions & 2 deletions src/app_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use diesel::PgConnection;
#[cfg(feature = "feat-database")]
use diesel::r2d2::ConnectionManager;
use log::info;
#[cfg(feature = "feat-templating")]
use tera::Tera;

use crate::app_state::{AppServices, MedullahState};
Expand Down Expand Up @@ -50,8 +51,11 @@ async fn create_app_state(setup: MedullahSetup) -> MedullahState {
let rabbit = Arc::new(establish_rabbit_connection(&env_prefix).await);

// templating
let tpl_dir = get_cwd() + "/resources/templates/**/*.tera.html";
let tera_templating = Tera::new(tpl_dir.as_str()).unwrap();
#[cfg(feature = "feat-templating")]
let tera_templating = {
let tpl_dir = get_cwd() + "/resources/templates/**/*.tera.html";
Tera::new(tpl_dir.as_str()).unwrap()
};

MedullahState {
app_id: env::var(format!("{}_APP_ID", env_prefix)).unwrap(),
Expand All @@ -71,6 +75,7 @@ async fn create_app_state(setup: MedullahSetup) -> MedullahState {
rabbit: rabbit.clone(),
#[cfg(feature = "feat-database")]
database: database_pool,
#[cfg(feature = "feat-templating")]
tera: tera_templating,

auth_iss_public_key: setup.auth_iss_public_key,
Expand Down

0 comments on commit ec6b747

Please sign in to comment.