* chore: begin switching to lapin fully Signed-off-by: Zomatree <me@zomatree.live> * chore: update rest of pushd to lapin Signed-off-by: Zomatree <me@zomatree.live> * chore: cleanup code Signed-off-by: Zomatree <me@zomatree.live> * chore: cleanup code Signed-off-by: Zomatree <me@zomatree.live> * fix: github webui sucks Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> --------- Signed-off-by: Zomatree <me@zomatree.live> Signed-off-by: Tom <iamtomahawkx@gmail.com> Signed-off-by: IAmTomahawkx <iamtomahawkx@gmail.com> Co-authored-by: Tom <iamtomahawkx@gmail.com> Release-As: 0.13.6
38 lines
869 B
Rust
38 lines
869 B
Rust
use std::env;
|
|
|
|
use revolt_database::DatabaseInfo;
|
|
use revolt_database::{voice::VoiceClient, AMQP};
|
|
use revolt_result::Result;
|
|
use rocket::{build, routes, Config};
|
|
use std::net::Ipv4Addr;
|
|
|
|
mod api;
|
|
mod guard;
|
|
|
|
#[rocket::main]
|
|
async fn main() -> Result<(), rocket::Error> {
|
|
revolt_config::configure!(voice_ingress);
|
|
|
|
let amqp = AMQP::new_auto().await;
|
|
|
|
let database = DatabaseInfo::Auto.connect().await.unwrap();
|
|
let voice_client = VoiceClient::from_revolt_config().await;
|
|
|
|
let _rocket = build()
|
|
.manage(database)
|
|
.manage(voice_client)
|
|
.manage(amqp)
|
|
.mount("/", routes![api::ingress])
|
|
.configure(Config {
|
|
port: 8500,
|
|
address: Ipv4Addr::new(0, 0, 0, 0).into(),
|
|
..Default::default()
|
|
})
|
|
.ignite()
|
|
.await?
|
|
.launch()
|
|
.await?;
|
|
|
|
Ok(())
|
|
}
|