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,10 @@
[package]
name = "rc_microtransactions"
version = "0.1.0"
edition = "2021"
[dependencies]
rocket.workspace = true
libfj.workspace = true
log.workspace = true
env_logger.workspace = true

View File

@@ -0,0 +1,12 @@
## defaults for _all_ profiles
[default]
address = "127.0.0.1"
port = 8011
## set only when compiled in debug mode, i.e, `cargo build`
[debug]
port = 8011
## set only when compiled in release mode, i.e, `cargo build --release`
[release]
address = "0.0.0.0"

View File

@@ -0,0 +1,3 @@
#!/bin/bash
cargo build --release --target aarch64-unknown-linux-musl

View File

@@ -0,0 +1,3 @@
#!/bin/bash
#cargo build
RUST_LOG=debug cargo run

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])
})
}