diff options
Diffstat (limited to 'src/main.py')
-rw-r--r-- | src/main.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/main.py b/src/main.py deleted file mode 100644 index b678aae..0000000 --- a/src/main.py +++ /dev/null @@ -1,28 +0,0 @@ -import sanic -import os - -import controller - -app = sanic.Sanic("Files") - -@app.get("/") -async def index(request): - return controller.index() - -@app.post("/", stream = True) -async def upload(request): - return await controller.upload(request) - -@app.get("/<file_id:str>") -async def file_page(request, file_id): - return await controller.file(file_id, download = False) - -@app.get("/<file_id:str>/download") -async def file_download(request, file_id): - return await controller.file(file_id, download = True) - -app.static("/static/", "static/") - -if __name__ == "__main__": - debug = 'DEBUG' in os.environ and os.environ['DEBUG'] == 'TRUE' - app.run(debug=debug, access_log=True) |