new name
This commit is contained in:
parent
5e9f49311e
commit
352d4e0a7a
38
Cargo.lock
generated
38
Cargo.lock
generated
@ -286,25 +286,6 @@ version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
|
||||
|
||||
[[package]]
|
||||
name = "cops-web"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"calibre-db",
|
||||
"clap",
|
||||
"once_cell",
|
||||
"poem",
|
||||
"rust-embed",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tera",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation-sys"
|
||||
version = "0.8.6"
|
||||
@ -1266,6 +1247,25 @@ version = "0.1.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
|
||||
|
||||
[[package]]
|
||||
name = "rusty-library"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"calibre-db",
|
||||
"clap",
|
||||
"once_cell",
|
||||
"poem",
|
||||
"rust-embed",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tera",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.17"
|
||||
|
@ -1,7 +1,7 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"calibre-db", "cops-web",
|
||||
"calibre-db", "rusty-library",
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "cops-web"
|
||||
name = "rusty-library"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
10
rusty-library/src/handlers/authors.rs
Normal file
10
rusty-library/src/handlers/authors.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use poem::{handler, web::Data};
|
||||
|
||||
use crate::app_state::AppState;
|
||||
|
||||
#[handler]
|
||||
pub async fn handler(state: Data<&Arc<AppState>>) -> Result<String, poem::Error> {
|
||||
Ok("authors".to_string())
|
||||
}
|
10
rusty-library/src/handlers/books.rs
Normal file
10
rusty-library/src/handlers/books.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use poem::{handler, web::Data};
|
||||
|
||||
use crate::app_state::AppState;
|
||||
|
||||
#[handler]
|
||||
pub async fn handler(state: Data<&Arc<AppState>>) -> Result<String, poem::Error> {
|
||||
Ok("books".to_string())
|
||||
}
|
10
rusty-library/src/handlers/series.rs
Normal file
10
rusty-library/src/handlers/series.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use poem::{handler, web::Data};
|
||||
|
||||
use crate::app_state::AppState;
|
||||
|
||||
#[handler]
|
||||
pub async fn handler(state: Data<&Arc<AppState>>) -> Result<String, poem::Error> {
|
||||
Ok("series".to_string())
|
||||
}
|
@ -18,10 +18,13 @@ mod data {
|
||||
pub mod book;
|
||||
}
|
||||
mod handlers {
|
||||
pub mod authors;
|
||||
pub mod books;
|
||||
pub mod cover;
|
||||
pub mod download;
|
||||
pub mod error;
|
||||
pub mod recents;
|
||||
pub mod series;
|
||||
}
|
||||
mod templates;
|
||||
|
||||
@ -44,6 +47,9 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
|
||||
let app = Route::new()
|
||||
.at("/", get(handlers::recents::handler))
|
||||
.at("/books", get(handlers::books::handler))
|
||||
.at("/authors", get(handlers::authors::handler))
|
||||
.at("/series", get(handlers::series::handler))
|
||||
.at("/cover/:id", get(handlers::cover::handler))
|
||||
.at("/book/:id/:format", get(handlers::download::handler))
|
||||
.nest("/static", EmbeddedFilesEndpoint::<Files>::new())
|
@ -6,10 +6,21 @@
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<link rel="stylesheet" href="/static/pico.min.css" />
|
||||
<link rel="stylesheet" href="/static/style.css" />
|
||||
<title>Hello world!</title>
|
||||
<title>Rusty Library</title>
|
||||
</head>
|
||||
<body>
|
||||
<main class="container">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><strong>Library</strong></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="/">Recent</a></li>
|
||||
<li><a href="/authors">Authors</a></li>
|
||||
<li><a href="/books">Books</a></li>
|
||||
<li><a href="/series">Series</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% block content %}{% endblock content %}
|
||||
</main>
|
||||
</body>
|
Loading…
Reference in New Issue
Block a user