sprint/FileStorage/root.py
2021-11-11 11:47:06 +03:00

22 lines
469 B
Python

import os
from os import mkdir
from os.path import exists
from aiohttp import web
from FileStorage.routes import setup_routes
def runserver():
app = web.Application()
setup_routes(app)
if not exists("data"):
mkdir("data")
if not exists("data/meta.txt"):
with open("data/meta.txt", "w") as fs:
fs.write("0")
web.run_app(app, host=os.getenv("FS_HOST", "0.0.0.0"), port=5555)
if __name__ == "__main__":
runserver()