mirror of
https://github.com/TheCaduceus/FileStreamBot.git
synced 2026-01-15 16:33:25 -03:00
Bump to v1.1
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
from quart import Quart
|
||||
from uvicorn import Config, Server as UvicornServer
|
||||
from hypercorn import Config
|
||||
from hypercorn.asyncio import serve
|
||||
from logging import getLogger
|
||||
from bot.config import Server, LOGGER_CONFIG_JSON
|
||||
|
||||
from . import main, error
|
||||
|
||||
logger = getLogger('uvicorn')
|
||||
logger = getLogger('hypercorn')
|
||||
instance = Quart(__name__)
|
||||
|
||||
@instance.before_serving
|
||||
@@ -20,11 +21,9 @@ instance.register_error_handler(404, error.not_found)
|
||||
instance.register_error_handler(405, error.invalid_method)
|
||||
instance.register_error_handler(error.HTTPError, error.http_error)
|
||||
|
||||
server = UvicornServer(
|
||||
Config(
|
||||
app = instance,
|
||||
host = Server.BIND_ADDRESS,
|
||||
port = Server.PORT,
|
||||
log_config = LOGGER_CONFIG_JSON
|
||||
)
|
||||
)
|
||||
async def run_server():
|
||||
config = Config()
|
||||
config.bind = [f'{Server.BIND_ADDRESS}:{Server.PORT}']
|
||||
config.logconfig_dict = LOGGER_CONFIG_JSON
|
||||
|
||||
await serve(instance, config)
|
||||
|
||||
Reference in New Issue
Block a user