removing unneeded endpoints

This commit is contained in:
2024-03-24 20:08:07 -03:00
parent e547ae41d4
commit 274fe5252a
6 changed files with 2 additions and 58 deletions

View File

@@ -64,26 +64,10 @@ async fn simulation_protobuf(msg: ProtoBuf<PersonProtobuf>) -> impl Responder {
HttpResponse::Ok().protobuf(msg.0)
}
#[get("/image/load-small-image")]
async fn load_small_image() -> Result<NamedFile> {
let real_path = "static/small-image.png";
Ok(NamedFile::open(real_path)?)
}
#[get("/image/load-big-image")]
async fn load_big_image() -> Result<NamedFile> {
let real_path = "static/big-image.png";
Ok(NamedFile::open(real_path)?)
}
#[post("/image/save-big-image")]
async fn save_big_image(image_data: web::Bytes) -> Result<HttpResponse> {
// Write bytes to file
std::fs::write("image.png", &image_data).unwrap();
// Return the blurred image bytes
Ok(HttpResponse::Ok()
.content_type("application/json")
.body("{\"status\": 200}"))
@@ -97,8 +81,6 @@ async fn main() -> std::io::Result<()> {
App::new()
.route("/static/{filename:.*}", web::get().to(static_serve))
.service(hello)
.service(load_small_image)
.service(load_big_image)
.service(save_big_image)
.service(simulation_harmonic_progression)
.service(simulation_json)