treewide: Migrate to clean-architecture

Signed-off-by: supercmmetry <vishaals2000@gmail.com>
This commit is contained in:
supercmmetry 2020-06-24 13:45:35 +05:30
parent 810af687c6
commit da21eb1189
No known key found for this signature in database
GPG Key ID: 8E60EF28A328E40D
13 changed files with 42 additions and 7 deletions

0
src/api/catchers/mod.rs Normal file
View File

0
src/api/guards/mod.rs Normal file
View File

0
src/api/misc/mod.rs Normal file
View File

5
src/api/mod.rs Normal file
View File

@ -0,0 +1,5 @@
pub mod routes;
pub mod catchers;
mod guards;
mod misc;

11
src/api/routes/health.rs Normal file
View File

@ -0,0 +1,11 @@
use rocket::Rocket;
#[get("/check")]
fn check() -> &'static str {
"OK"
}
pub fn fuel(rocket: Rocket) -> Rocket {
rocket.mount("/api/health", routes![check])
}

12
src/api/routes/mod.rs Normal file
View File

@ -0,0 +1,12 @@
use rocket::Rocket;
pub mod health;
pub fn fuel(rocket: Rocket) -> Rocket {
let mut rocket = rocket;
rocket = health::fuel(rocket);
rocket
}

1
src/core/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod paste;

0
src/core/paste/diesel.rs Normal file
View File

0
src/core/paste/entity.rs Normal file
View File

4
src/core/paste/mod.rs Normal file
View File

@ -0,0 +1,4 @@
pub mod entity;
pub mod repository;
pub mod diesel;
pub mod service;

View File

View File

View File

@ -3,13 +3,15 @@
#[macro_use]
extern crate rocket;
#[get("/alive")]
fn alive() -> &'static str {
"OK"
}
pub mod api;
pub mod core;
fn main() {
rocket::ignite()
.mount("/", routes![index])
.launch();
let mut rocket = rocket::ignite();
rocket = api::routes::fuel(rocket);
rocket.launch();
}