mirror of
https://github.com/TeamNewPipe/web-api
synced 2025-10-06 08:12:52 +02:00
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!
24 lines
544 B
Python
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()
|