mirror of
https://github.com/ivanch/tcc.git
synced 2025-08-25 15:21:49 +00:00
removing unneeded endpoints
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user