mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 05:26:59 +00:00
Add /api route handler
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
use rocket::Rocket;
|
||||
|
||||
pub mod root;
|
||||
pub mod account;
|
||||
pub mod user;
|
||||
pub mod channel;
|
||||
|
||||
pub fn mount(rocket: Rocket) -> Rocket {
|
||||
rocket
|
||||
.mount("/api", routes![ root::root ])
|
||||
.mount("/api/account", routes![ account::create, account::verify_email, account::resend_email, account::login, account::token ])
|
||||
.mount("/api/users", routes![ user::me, user::user, user::lookup, user::dms, user::dm, user::get_friends, user::get_friend, user::add_friend, user::remove_friend ])
|
||||
.mount("/api/channels", routes![ channel::channel, channel::delete, channel::messages, channel::send_message, channel::edit_message, channel::delete_message ])
|
||||
|
||||
10
src/routes/root.rs
Normal file
10
src/routes/root.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use rocket_contrib::json::{ JsonValue };
|
||||
use bson::{ bson, doc };
|
||||
|
||||
/// root
|
||||
#[get("/")]
|
||||
pub fn root() -> JsonValue {
|
||||
json!({
|
||||
"revolt": "0.0.1"
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user