Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
1
crates/scel/.gitignore
vendored
Normal file
1
crates/scel/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target
|
16
crates/scel/Cargo.toml
Normal file
16
crates/scel/Cargo.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "scel"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.22", features = ["full"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
anyhow = { version = "1.0.66" }
|
||||
dotenv = { version = "*" }
|
||||
|
||||
scel_api = { path = "../scel_api" }
|
||||
scel_core = { path = "../scel_core" }
|
28
crates/scel/src/main.rs
Normal file
28
crates/scel/src/main.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use dotenv::dotenv;
|
||||
use scel_core::App;
|
||||
use tracing::info;
|
||||
use tracing_subscriber::{EnvFilter, FmtSubscriber};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
dotenv().ok();
|
||||
|
||||
let subscriber = FmtSubscriber::builder()
|
||||
.with_env_filter(
|
||||
EnvFilter::default()
|
||||
.add_directive("tower_http=debug".parse().unwrap())
|
||||
.add_directive("scel_api=info".parse().unwrap())
|
||||
.add_directive("scel=info".parse().unwrap()),
|
||||
)
|
||||
.finish();
|
||||
|
||||
tracing::subscriber::set_global_default(subscriber)?;
|
||||
|
||||
info!("Starting scel");
|
||||
|
||||
let app = Arc::new(App::new());
|
||||
|
||||
scel_api::Server::new(app.clone()).start().await
|
||||
}
|
Reference in New Issue
Block a user