mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 02:48:21 +00:00
Add temp api handle
This commit is contained in:
parent
3a9be114d8
commit
faf446d93a
1 changed files with 23 additions and 2 deletions
|
@ -1,5 +1,26 @@
|
||||||
use axum::Router;
|
use super::super::AppState;
|
||||||
|
use axum::routing::post;
|
||||||
|
use axum::{Json, Router};
|
||||||
|
use tower_cookies::{Cookie, Cookies};
|
||||||
|
|
||||||
|
use axum::{
|
||||||
|
extract::Extension,
|
||||||
|
extract::State,
|
||||||
|
http::{Request, StatusCode},
|
||||||
|
middleware::{self, Next},
|
||||||
|
response::{IntoResponse, Response},
|
||||||
|
};
|
||||||
|
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
pub fn routes() -> Router<super::super::AppState> {
|
pub fn routes() -> Router<super::super::AppState> {
|
||||||
Router::new()
|
Router::new().route("/api", post(api_handler))
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn api_handler(
|
||||||
|
State(state): State<AppState>,
|
||||||
|
session: Extension<super::auth::Session>,
|
||||||
|
) -> impl IntoResponse {
|
||||||
|
info!("api hit! user: {:?}", session.username);
|
||||||
|
StatusCode::NOT_IMPLEMENTED
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue