start working on auth

This commit is contained in:
2023-04-03 16:11:26 +02:00
parent 3dbfadb00e
commit d50f3d9746
12 changed files with 485 additions and 106 deletions

View File

@ -1,14 +1,21 @@
use rocket::{get, routes, Build, Rocket};
use rocket_dyn_templates::Template;
use rocket_dyn_templates::{context, Template};
use sqlx::SqlitePool;
use crate::model::user::Users;
mod auth;
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
fn index() -> Template {
Template::render("index", context! {})
}
pub fn start() -> Rocket<Build> {
pub fn start(db: SqlitePool) -> Rocket<Build> {
rocket::build()
.manage(db)
.mount("/", routes![index])
.mount("/auth", auth::routes())
.attach(Template::fairing())
}