Add canapi and try to use for the API

This commit is contained in:
Bat
2018-09-19 15:49:34 +01:00
parent eb24ba1774
commit 1500267125
16 changed files with 211 additions and 10 deletions
+4
View File
@@ -36,6 +36,7 @@ use rocket_contrib::Template;
use rocket_csrf::CsrfFairingBuilder;
use workerpool::{Pool, thunk::ThunkWorker};
mod api;
mod inbox;
mod setup;
mod routes;
@@ -142,6 +143,9 @@ fn main() {
routes::errors::csrf_violation
])
.mount("/api/v1", routes![
api::posts::get
])
.catch(catchers![
routes::errors::not_found,
routes::errors::server_error