Updated Documentation and Mii Renderer URL
This commit is contained in:
parent
3184001ed2
commit
c91aa25565
3 changed files with 19 additions and 7 deletions
21
src/main.rs
21
src/main.rs
|
|
@ -5,7 +5,7 @@ use rocket::State;
|
|||
use reqwest::Client;
|
||||
use bytes::Bytes;
|
||||
|
||||
static MII_RENDERER_URL: &str = "https://mii-render.spfn.net";
|
||||
static MII_RENDERER_URL: &str = "https://mii-renderer.spfn.net";
|
||||
|
||||
static ALLOWED_FORMATS: [&str; 2] = [
|
||||
"png",
|
||||
|
|
@ -17,10 +17,23 @@ async fn request_mii_render(client: &State<Client>, mii_data: &str, ext: &str) -
|
|||
|
||||
let response = client.get(req_str)
|
||||
.send()
|
||||
.await
|
||||
.ok()?;
|
||||
.await;
|
||||
|
||||
Some(response.bytes().await.expect("Failed to parse Mii Render to Bytes"))
|
||||
match response {
|
||||
Ok(res) => {
|
||||
Some(res.bytes().await.expect("Failed to parse Mii Render to Bytes"))
|
||||
}
|
||||
Err(err) => {
|
||||
let status = match err.status() {
|
||||
Some(err_status) => {
|
||||
err_status.to_string()
|
||||
}
|
||||
None => String::from("No Response")
|
||||
};
|
||||
println!("Error Requesting New Render - {}", status);
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[rocket::get("/<pid_str>/<path>")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue