Exemplo n.º 1
0
def create_general_meme(image: _fastapi.UploadFile = _fastapi.File(...)):
    file_path = _services.upload_image("memes", image)
    if file_path is None:
        return _fastapi.HTTPException(status_code=409,
                                      detail="incorrect file type")
    return _responses.FileResponse(file_path)
def privacy_policy():
    return responses.FileResponse(os.path.join(DOCUMENTS_PATH,
                                               'privacy_policy.pdf'),
                                  media_type='application/pdf')
Exemplo n.º 3
0
def get_general_memes():
    image_path = _services.select_random_image("memes")
    return _responses.FileResponse(image_path)
def terms_of_service():
    return responses.FileResponse(os.path.join(DOCUMENTS_PATH,
                                               'terms_of_service.pdf'),
                                  media_type='application/pdf')
Exemplo n.º 5
0
def get_meme():
    return _responses.FileResponse("ProgrammerHumor/tq00bck4mov61.gif")
Exemplo n.º 6
0
def get_cat_memes():
    image_path = _services.select_random_image("Catmemes")
    return _responses.FileResponse(image_path)
Exemplo n.º 7
0
def post_programmer_meme(image: _fastapi.UploadFile = _fastapi.File(...)):
    file_name = _services.upload_image("ProgrammerHumor", image)
    if file_name is None:
        return _fastapi.HTTPException(status_code=409,
                                      detail="incorrect file type")
    return _responses.FileResponse(file_name)
Exemplo n.º 8
0
def get_programmer_meme():
    image_path = _services.select_random_image("ProgrammerHumor")
    return _responses.FileResponse(image_path)