1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 00:34:41 -05:00
This commit is contained in:
Ashley 2023-12-10 10:26:38 +00:00
parent 91ee786fc0
commit ff13d57563

31
january/src/main.rs Normal file
View file

@ -0,0 +1,31 @@
#[macro_use]
extern crate lazy_static;
use actix_web::middleware::Logger;
use actix_web::{web, App, HttpServer};
use log::info;
use util::variables::HOST;
pub mod routes;
pub mod structs;
pub mod util;
#[actix_web::main]
async fn main() -> std::io::Result<()> {
dotenv::dotenv().ok();
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "info"));
info!("Starting January server.");
HttpServer::new(|| {
App::new()
.wrap(Logger::default())
.route("/", web::get().to(routes::info::get))
.route("/embed", web::get().to(routes::embed::get))
.route("/proxy", web::get().to(routes::proxy::get))
})
.bind(HOST.clone())?
.run()
.await
}