Moved url_prefix to bp mount instead of creation
continuous-integration/drone the build failed Details

basic-search
Jef Roosens 2021-05-19 12:07:23 +02:00
parent 274a870a6a
commit 5d36a8e533
Signed by: Jef Roosens
GPG Key ID: B580B976584B5F30
3 changed files with 7 additions and 7 deletions

View File

@ -1,9 +1,9 @@
"""Entrypoint for the program."""
from quart import Quart
from app.api import blueprint
from app.api import api_bp
app = Quart("jos", static_folder="web/dist", static_url_path="/")
app.register_blueprint(blueprint)
app.register_blueprint(api_bp, url_prefix="/api")
@app.route("/", methods=["GET"], defaults={"path": ""})

View File

@ -1,8 +1,8 @@
"""Module containing all Flask-related code."""
from quart import Blueprint
from .search import blueprint as search_blueprint
from .search import search_bp
# Main blueprint exposing entire API
blueprint = Blueprint("api", __name__, url_prefix="/api")
blueprint.register_blueprint(search_blueprint)
api_bp = Blueprint("api", __name__)
api_bp.register_blueprint(search_bp, url_prefix="/search")

View File

@ -2,10 +2,10 @@
from quart import Blueprint
blueprint = Blueprint("search", __name__, url_prefix="/search")
search_bp = Blueprint("search", __name__)
@blueprint.route("/", methods=["GET"])
@search_bp.route("/", methods=["GET"])
async def search_spotify():
"""Search the Spotify API."""
return "yeet"