This commit is contained in:
JMARyA 2024-12-26 00:37:50 +01:00
commit 221b2a82e7
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
7 changed files with 3817 additions and 0 deletions

36
src/main.rs Normal file
View file

@ -0,0 +1,36 @@
// TODO :
// - Base
// - API
// - UI
// - PkgDB Abstraction
// - Pkg Abstraction
use based::page::{Shell, render_page};
use based::request::{RequestContext, StringResponse};
use maud::html;
use rocket::get;
use rocket::routes;
pub mod pkg;
pub mod routes;
#[get("/")]
pub async fn index_page(ctx: RequestContext) -> StringResponse {
let content = html!(
h1 { "Hello World!" };
);
render_page(
content,
"Hello World",
ctx,
&Shell::new(html! {}, html! {}, Some(String::new())),
)
.await
}
#[rocket::launch]
async fn launch() -> _ {
env_logger::init();
rocket::build().mount("/", routes![index_page, routes::pkg_route])
}