add gitea sig header check, add Json errors, begin AppState
This commit is contained in:
+16
-3
@@ -1,11 +1,24 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::{bot::Bot, state::AppState};
|
||||
|
||||
mod api;
|
||||
mod env;
|
||||
mod gitea;
|
||||
mod bot;
|
||||
mod env;
|
||||
mod errors;
|
||||
mod gitea;
|
||||
mod state;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let config = env::load_config()?;
|
||||
|
||||
api::start_api(config).await
|
||||
let app_state = AppState {
|
||||
bot: Arc::new(Mutex::new(Bot::new(config.clone()))),
|
||||
config: config,
|
||||
};
|
||||
|
||||
api::start(app_state).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user