From 6b066bba0582040e8c21e02eefc77fb285c6685a Mon Sep 17 00:00:00 2001 From: slice Date: Sat, 16 Jun 2018 17:00:11 -0700 Subject: [PATCH] add base /gateway bp --- litecord/blueprints/__init__.py | 1 + litecord/blueprints/gateway.py | 10 ++++++++++ run.py | 4 +++- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 litecord/blueprints/__init__.py create mode 100644 litecord/blueprints/gateway.py diff --git a/litecord/blueprints/__init__.py b/litecord/blueprints/__init__.py new file mode 100644 index 0000000..6114c6c --- /dev/null +++ b/litecord/blueprints/__init__.py @@ -0,0 +1 @@ +from .gateway import bp as gateway diff --git a/litecord/blueprints/gateway.py b/litecord/blueprints/gateway.py new file mode 100644 index 0000000..7cdff33 --- /dev/null +++ b/litecord/blueprints/gateway.py @@ -0,0 +1,10 @@ +from quart import Blueprint, jsonify + +bp = Blueprint('gateway', __name__) + + +@bp.route('/gateway') +def api_gateway(): + return jsonify({"url": "..."}) + +# TODO: /gateway/bot (requires token) diff --git a/run.py b/run.py index f570da2..d561487 100644 --- a/run.py +++ b/run.py @@ -1,9 +1,10 @@ import logging import asyncpg -from quart import Quart, g +from quart import Quart, g, Blueprint import config +from litecord.blueprints import gateway logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) @@ -16,6 +17,7 @@ def make_app(): app = make_app() +app.register_blueprint(gateway, url_prefix='/api/v6') @app.before_serving