init
This commit is contained in:
commit
221b2a82e7
7 changed files with 3817 additions and 0 deletions
36
src/main.rs
Normal file
36
src/main.rs
Normal 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])
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue