from uvicorn import Config, Server

from onigiri import app, loop
from onigiri.database import init_database

config = Config(host="127.0.0.1", port=5000, app=app, loop=loop, lifespan="on")
server = Server(config)


async def main():
    await init_database()
    await server.serve()


if __name__ == "__main__":
    loop.run_until_complete(main())

from uvicorn import Config, Server

from onigiri import app, loop
from onigiri.database import init_database

config = Config(host="127.0.0.1", port=5000, app=app, loop=loop, lifespan="on")
server = Server(config)


async def main():
    await init_database()
    await server.serve()


if __name__ == "__main__":
    loop.run_until_complete(main())
