diff --git a/packages/backend-rs/src/config/environment.rs b/packages/backend-rs/src/config/environment.rs index b38d21e99..cdb1d19fd 100644 --- a/packages/backend-rs/src/config/environment.rs +++ b/packages/backend-rs/src/config/environment.rs @@ -1,4 +1,4 @@ -#[cfg_attr(feature = "napi", napi_derive::napi)] +#[napi_derive::napi] pub struct EnvConfig { pub only_queue: bool, pub only_server: bool, @@ -10,7 +10,7 @@ pub struct EnvConfig { pub slow: bool, } -#[cfg_attr(feature = "napi", napi_derive::napi)] +#[napi_derive::napi] pub fn read_environment_config() -> EnvConfig { let node_env = std::env::var("NODE_ENV").unwrap_or_default().to_lowercase(); let is_testing = node_env == "test" || node_env == "testing"; diff --git a/packages/backend-rs/src/config/server.rs b/packages/backend-rs/src/config/server.rs index f9adc54d3..ba754f408 100644 --- a/packages/backend-rs/src/config/server.rs +++ b/packages/backend-rs/src/config/server.rs @@ -5,7 +5,7 @@ use std::fs; #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct ServerConfig { pub url: String, pub db: DbConfig, @@ -14,7 +14,7 @@ pub struct ServerConfig { } #[derive(Debug, PartialEq, Deserialize)] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct DbConfig { pub host: String, pub port: u32, @@ -24,7 +24,7 @@ pub struct DbConfig { } #[derive(Debug, PartialEq, Deserialize)] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct RedisConfig { pub host: String, pub port: u32, @@ -39,13 +39,13 @@ pub struct RedisConfig { #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct TlsConfig { pub host: String, pub reject_unauthorized: bool, } -#[cfg_attr(feature = "napi", napi_derive::napi)] +#[napi_derive::napi] pub fn read_server_config() -> ServerConfig { let cwd = env::current_dir().unwrap(); let yml = fs::File::open(cwd.join("../../.config/default.yml"))