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 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
|
||||
],
|
||||
);
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
pub mod posts;
|
||||
pub mod sections;
|
Reference in New Issue