From 13cdbc7ff760ae91ee3f62b2a2f62c7559ccaa3c Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 14 Dec 2021 20:23:07 +0100 Subject: test registration & login --- backend/src/lib.rs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 backend/src/lib.rs (limited to 'backend/src/lib.rs') diff --git a/backend/src/lib.rs b/backend/src/lib.rs new file mode 100644 index 0000000..0a21850 --- /dev/null +++ b/backend/src/lib.rs @@ -0,0 +1,35 @@ +#![feature(proc_macro_hygiene, decl_macro)] + +use rocket::{Build, Rocket}; +use rocket_sync_db_pools::database; + +#[macro_use] +extern crate rocket; +#[macro_use] +extern crate diesel; + +mod db; +mod routes; +mod schema; + +#[database("postgresql_database")] +pub struct DbConn(diesel::PgConnection); + +#[get("/")] +fn index() -> &'static str { + "Hello, world!" +} + +pub fn rocket() -> Rocket { + rocket::build() + .mount( + "/", + routes![ + index, + routes::users::register, + routes::users::login, + routes::users::current_user, + ], + ) + .attach(DbConn::fairing()) +} -- cgit v1.2.3