Moved routes to versioned prefix
parent
d3d3771d22
commit
7aee0282b2
27
src/main.rs
27
src/main.rs
|
@ -17,8 +17,7 @@ use rocket::{
|
||||||
use rocket_sync_db_pools::database;
|
use rocket_sync_db_pools::database;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub mod posts;
|
pub mod v1;
|
||||||
pub mod sections;
|
|
||||||
|
|
||||||
#[database("postgres_rb")]
|
#[database("postgres_rb")]
|
||||||
pub struct RbDbConn(diesel::PgConnection);
|
pub struct RbDbConn(diesel::PgConnection);
|
||||||
|
@ -66,23 +65,23 @@ fn rocket() -> _
|
||||||
// .attach(AdHoc::config::<JwtConf>())
|
// .attach(AdHoc::config::<JwtConf>())
|
||||||
.register("/", catchers![default_catcher])
|
.register("/", catchers![default_catcher])
|
||||||
.mount(
|
.mount(
|
||||||
"/sections",
|
"/v1/sections",
|
||||||
routes![
|
routes![
|
||||||
sections::get,
|
v1::sections::get,
|
||||||
sections::create,
|
v1::sections::create,
|
||||||
sections::find,
|
v1::sections::find,
|
||||||
sections::patch,
|
v1::sections::patch,
|
||||||
sections::delete
|
v1::sections::delete
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.mount(
|
.mount(
|
||||||
"/posts",
|
"/v1/posts",
|
||||||
routes![
|
routes![
|
||||||
posts::get,
|
v1::posts::get,
|
||||||
posts::create,
|
v1::posts::create,
|
||||||
posts::find,
|
v1::posts::find,
|
||||||
posts::patch,
|
v1::posts::patch,
|
||||||
posts::delete
|
v1::posts::delete
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
pub mod posts;
|
||||||
|
pub mod sections;
|
Reference in New Issue