mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-25 17:28:37 +01:00
ini
This commit is contained in:
parent
91ee786fc0
commit
ff13d57563
1 changed files with 31 additions and 0 deletions
31
january/src/main.rs
Normal file
31
january/src/main.rs
Normal 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
|
||||
}
|
Loading…
Reference in a new issue