Got rid of the dotenvy_macro package and docker preparation
This commit is contained in:
parent
0b7549c2b6
commit
e548f1b268
|
@ -169,18 +169,6 @@ version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dotenvy_macro"
|
|
||||||
version = "0.15.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cb0235d912a8c749f4e0c9f18ca253b4c28cfefc1d2518096016d6e3230b6424"
|
|
||||||
dependencies = [
|
|
||||||
"dotenvy",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn 1.0.109",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.8.1"
|
version = "1.8.1"
|
||||||
|
@ -438,7 +426,6 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"axum",
|
"axum",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
"dotenvy_macro",
|
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"log",
|
"log",
|
||||||
"magick_rust",
|
"magick_rust",
|
||||||
|
|
|
@ -3,13 +3,15 @@ edition = "2021"
|
||||||
name = "liquid-rescale-api"
|
name = "liquid-rescale-api"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# This seems redundant, but it's necessary for Docker to work
|
||||||
|
[[bin]]
|
||||||
|
name = "liquid-rescale-api"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.70"
|
anyhow = "1.0.70"
|
||||||
axum = {version = "0.6", features = ["multipart", "macros"]}
|
axum = {version = "0.6", features = ["multipart", "macros"]}
|
||||||
dotenvy = "0.15.7"
|
dotenvy = "0.15.7"
|
||||||
dotenvy_macro = "0.15.7"
|
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.10.0"
|
||||||
log = "0.4.17"
|
log = "0.4.17"
|
||||||
magick_rust = "0.17.0"
|
magick_rust = "0.17.0"
|
||||||
|
|
|
@ -3,12 +3,10 @@ mod router;
|
||||||
mod routes;
|
mod routes;
|
||||||
mod utilities;
|
mod utilities;
|
||||||
|
|
||||||
use dotenvy_macro::dotenv;
|
|
||||||
use router::create_router;
|
use router::create_router;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
pub async fn run() {
|
pub async fn run(port: String) {
|
||||||
let port = dotenv!("PORT");
|
|
||||||
let app = create_router();
|
let app = create_router();
|
||||||
let address = SocketAddr::from(([0, 0, 0, 0], port.parse().unwrap()));
|
let address = SocketAddr::from(([0, 0, 0, 0], port.parse().unwrap()));
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ use log::info;
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
|
let port = dotenvy::var("PORT").unwrap_or("3000".to_string());
|
||||||
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
|
||||||
info!("Starting app on {}", dotenvy::var("PORT").unwrap());
|
info!("Starting app on {}", port);
|
||||||
run().await;
|
run(port).await;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue