Moibe commited on
Commit
8972247
·
1 Parent(s): e765460

Primer función

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -29,6 +29,16 @@ async def echo_image(image: UploadFile = File(...)):
29
  contents = await image.read()
30
  return StreamingResponse(BytesIO(contents), media_type=image.content_type)
31
 
 
 
 
 
 
 
 
 
 
 
32
  @app.post("/genera-imagen/")
33
  async def genera_imagen(platillo: str = Form(...)):
34
 
 
29
  contents = await image.read()
30
  return StreamingResponse(BytesIO(contents), media_type=image.content_type)
31
 
32
+ @app.post("/procesa-dni/",
33
+ description="Procesa DNI.",
34
+ summary="Summary"
35
+ )
36
+ async def echo_image(image: UploadFile = File(...)):
37
+ if not image.content_type.startswith("image/"):
38
+ return {"error": "El archivo no es una imagen"}
39
+ contents = await image.read()
40
+ return StreamingResponse(BytesIO(contents), media_type=image.content_type)
41
+
42
  @app.post("/genera-imagen/")
43
  async def genera_imagen(platillo: str = Form(...)):
44