1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Stub out payment store web server #9, implement/fix last of login process #8

This commit is contained in:
NGnius (Graham)
2025-03-02 09:52:44 -05:00
parent 7e31f6fe1d
commit f004ca8565
15 changed files with 123 additions and 21 deletions

View File

@@ -0,0 +1,14 @@
mod robocraft;
#[rocket::get("/")]
fn index() -> &'static str {
"Hello, world!"
}
#[rocket::launch]
fn rocket() -> _ {
env_logger::init();
rocket::build().mount("/", rocket::routes![index])
.attach(robocraft::stage())
}

View File

@@ -0,0 +1,7 @@
mod store;
pub fn stage() -> rocket::fairing::AdHoc {
rocket::fairing::AdHoc::on_ignite("JSON", |rocket| async {
rocket.attach(store::stage())
})
}

View File

@@ -0,0 +1,17 @@
use rocket::{post, routes, serde::json::{json, Value}};
#[post("/robopay/store")]
pub fn robopay_store() -> Value {
// TODO authentication (Authorization header is "Robocraft {JWT token from auth}")
json!({
"response": {
"data": []
}
})
}
pub fn stage() -> rocket::fairing::AdHoc {
rocket::fairing::AdHoc::on_ignite("Robocraft store info", |rocket| async {
rocket.mount("/", routes![robopay_store])
})
}