Moved routes to versioned prefix

pull/3/head
Jef Roosens 2021-11-24 17:51:52 +01:00
parent d3d3771d22
commit 7aee0282b2
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
4 changed files with 15 additions and 14 deletions

View File

@ -17,8 +17,7 @@ use rocket::{
use rocket_sync_db_pools::database;
use serde::{Deserialize, Serialize};
pub mod posts;
pub mod sections;
pub mod v1;
#[database("postgres_rb")]
pub struct RbDbConn(diesel::PgConnection);
@ -66,23 +65,23 @@ fn rocket() -> _
// .attach(AdHoc::config::<JwtConf>())
.register("/", catchers![default_catcher])
.mount(
"/sections",
"/v1/sections",
routes![
sections::get,
sections::create,
sections::find,
sections::patch,
sections::delete
v1::sections::get,
v1::sections::create,
v1::sections::find,
v1::sections::patch,
v1::sections::delete
],
)
.mount(
"/posts",
"/v1/posts",
routes![
posts::get,
posts::create,
posts::find,
posts::patch,
posts::delete
v1::posts::get,
v1::posts::create,
v1::posts::find,
v1::posts::patch,
v1::posts::delete
],
);

2
src/v1/mod.rs 100644
View File

@ -0,0 +1,2 @@
pub mod posts;
pub mod sections;