logo-generator/src/main.rs

28 lines
617 B
Rust
Raw Normal View History

2023-03-11 21:44:17 +01:00
use axum::Router;
2023-03-11 21:08:09 +01:00
use std::net::SocketAddr;
2023-03-11 22:45:14 +01:00
mod color;
2023-03-11 21:44:17 +01:00
mod polygon;
mod routes;
#[derive(Clone)]
pub struct SharedState {}
2023-03-11 21:08:09 +01:00
#[tokio::main]
async fn main() {
2023-03-11 21:44:17 +01:00
let state = SharedState {};
let app = Router::new()
2023-03-11 22:45:14 +01:00
.nest("/", routes::static_files::routes())
2023-03-11 21:44:17 +01:00
.nest("/logo", routes::logo::routes())
.nest("/favicon.ico", routes::favicon::routes())
.with_state(state);
2023-03-11 21:08:09 +01:00
// run it
2023-03-12 00:04:47 +01:00
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
2023-03-11 21:08:09 +01:00
println!("listening on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
}