1
0
mirror of https://github.com/TeamNewPipe/web-api synced 2025-10-06 08:12:52 +02:00
Files
web-api/np_web_api/__main__.py
TheAssassin 57d78d705f Port everything to Quart and Poetry
Unfortunately, it became one huge commit, but it was a single file before, and would've had to be splitted beforehand... The Poetry port could've _maybe_ separated, but on the other hand, this app isn't _that_ complex.
Nevertheless, not good practice. Kids, don't try this at home!
2021-01-09 15:25:48 +01:00

24 lines
544 B
Python

import asyncio
import logging
from . import make_app
from ._logging import configure_logging
def main():
# set up logging once
configure_logging(logging.DEBUG)
app = make_app(debug=True)
# note: we must specifically pass the event loop we want to use to avoid issues with futures from other loops in
# the synchronization in the views module
# https://stackoverflow.com/a/56704621
loop = asyncio.get_event_loop()
# always run in debug mode, if launched directly
app.run(debug=True, loop=loop)
main()