const-dotenvy
===
[](https://crates.io/crates/const-dotenvy/)
[](https://docs.rs/const-dotenvy/)
A rust crate to read environment variables at compile-time and embed them into the code.
For example:
```rust
let (host, port, use_tls): (&'static str, u16, bool) = const_dotenvy::dotenvy!(
HOST: &'static str,
PORT: u16 = 8080,
USE_TLS: bool = false
);
```
will become
```rust
let (host, port, use_tls): (&'static str, u16, bool) = ("localhost", 8080, false);
```
It uses [`dotenvy`] crate to read the environment file located in the source folder at compile-time, then expands to the read value.
[`dotenvy`]: https://crates.io/crates/dotenvy