logo-generator/src/main.rs

26 lines
557 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 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()
.nest("/logo", routes::logo::routes())
.nest("/favicon.ico", routes::favicon::routes())
.with_state(state);
2023-03-11 21:08:09 +01:00
// run it
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
println!("listening on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
}