chore: first working version with integration test

This commit is contained in:
Sandro Eiler 2023-11-12 14:11:13 +01:00
parent f869b0f067
commit 122c38a0da
19 changed files with 266 additions and 1214 deletions

24
src/lib.rs Normal file
View file

@ -0,0 +1,24 @@
#![allow(unused)]
use axum::extract::{Path, Query};
use axum::http::{Method, Uri};
use axum::response::{Html, IntoResponse, Response};
use axum::routing::{get, get_service, IntoMakeService};
use axum::Server;
use axum::{middleware, Json, Router};
use hyper::server::conn::AddrIncoming;
use std::net::SocketAddr;
use std::net::TcpListener;
pub type App = Server<AddrIncoming, IntoMakeService<Router>>;
/// API routes
fn app() -> Router {
Router::new().route("/health_check", get(|| async {}))
}
/// Start the server
pub fn run(listener: TcpListener) -> hyper::Result<App> {
let app = app();
let server = Server::from_tcp(listener)?.serve(app.into_make_service());
Ok(server)
}