Basic frontend
I'm sorry for the big commit - Added yarte templating engine - Wrote frontend: all HTML except file input area, basic CSS (themes soon), JS. No client-side encryption yet. And no working API. - Simple but handy build system in Makefile (requires pacman -S entr / apt install entr)
This commit is contained in:
parent
4b6b3f7da4
commit
96376f2fba
12 changed files with 805 additions and 11 deletions
13
src/main.rs
13
src/main.rs
|
@ -1,11 +1,16 @@
|
|||
use ntex::web::{self, App};
|
||||
use ntex_files;
|
||||
|
||||
mod pages;
|
||||
|
||||
#[ntex::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
web::server(move || App::new().service(pages::index))
|
||||
.bind("127.0.0.1:3002")?
|
||||
.run()
|
||||
.await
|
||||
web::server(move || {
|
||||
App::new()
|
||||
.service(pages::index)
|
||||
.service(ntex_files::Files::new("/static", "./static"))
|
||||
})
|
||||
.bind("127.0.0.1:3002")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
use ntex::web::{self, HttpResponse};
|
||||
use yarte::TemplateMin;
|
||||
|
||||
#[derive(TemplateMin)]
|
||||
#[template(path = "index")]
|
||||
struct MainPageTemplate;
|
||||
|
||||
#[web::get("/")]
|
||||
pub async fn index() -> HttpResponse {
|
||||
HttpResponse::Ok()
|
||||
.content_type("text/html; charset=utf-8")
|
||||
.body("<h1>dc09's bin</h1>")
|
||||
.body(MainPageTemplate {}.to_string())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue