Base login setup

This commit is contained in:
LeNei
2025-03-28 15:18:59 +01:00
parent 15e834060d
commit 894d58c6c9
35 changed files with 1405 additions and 23 deletions

View File

@@ -9,14 +9,11 @@ async fn ping() -> StatusCode {
StatusCode::OK
}
pub fn routes(api_context: ApiContext) -> Router {
pub fn routes() -> Router<ApiContext> {
let cors = CorsLayer::new()
// allow `GET` and `POST` when accessing the resource
.allow_methods([Method::GET, Method::POST])
// allow requests from any origin
.allow_origin(Any);
Router::new()
.route("/ping", get(ping))
.layer(cors)
.with_state(api_context)
Router::new().route("/ping", get(ping)).layer(cors)
}