mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Implement stub 'read' echo API
This commit is contained in:
parent
0d25e1c196
commit
5eaa5b7950
1 changed files with 9 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ use std::sync::{mpsc, RwLock, Arc};
|
|||
|
||||
use rouille;
|
||||
|
||||
use web_util::json_response;
|
||||
use web_util::{read_json, json_response};
|
||||
use id::Id;
|
||||
use rbx::RbxInstance;
|
||||
use rbx_session::RbxSession;
|
||||
|
|
@ -138,7 +138,14 @@ pub fn start(config: WebConfig) {
|
|||
})
|
||||
},
|
||||
|
||||
// TODO: API to read only specific instances
|
||||
(POST) (/read) => {
|
||||
let body = match read_json::<Vec<Vec<String>>>(request) {
|
||||
Some(body) => body,
|
||||
None => return rouille::Response::text("Malformed JSON").with_status_code(400),
|
||||
};
|
||||
|
||||
rouille::Response::json(&body)
|
||||
},
|
||||
|
||||
_ => rouille::Response::empty_404()
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue