Initial commit

This commit is contained in:
Aleksandr 2024-11-17 14:58:34 +03:00
commit 4a04bfae91
31 changed files with 3297 additions and 0 deletions

View file

@ -0,0 +1,18 @@
use axum::{extract::Path, routing::get};
use crate::{
result::ApiResult,
schemas::{novel::FullNovel, sanity::Slug},
state::{Router, State},
};
async fn get_novel(Path(slug): Path<Slug>, state: State) -> ApiResult<FullNovel> {
let entry = state.app.read().novel(&slug.0)?;
let novel = entry.get_full_info()?;
Ok(novel.into())
}
pub fn make() -> Router {
Router::new().route("/", get(get_novel))
}