monorepo/visions/server/src/main.rs

34 lines
739 B
Rust

use core::Core;
use std::path::PathBuf;
use asset_db::FsAssets;
use database::DbConn;
mod asset_db;
mod core;
mod database;
mod handlers;
mod routes;
mod types;
#[tokio::main]
pub async fn main() {
/*
pretty_env_logger::init();
let unauthenticated_endpoints = route_healthcheck().or(route_authenticate(core.clone()));
let authenticated_endpoints = route_image(core.clone());
*/
let conn = DbConn::new(Some("/home/savanni/game.db"));
let core = Core::new(FsAssets::new(PathBuf::from("/home/savanni/Pictures")), conn);
let app = routes::routes(core);
let listener = tokio::net::TcpListener::bind("127.0.0.1:8001")
.await
.unwrap();
axum::serve(listener, app).await.unwrap();
}