Skip to content

Commit

Permalink
Created an API index at the top level, added it to the web page, and …
Browse files Browse the repository at this point in the history
…removed the one in ska_api blueprint. Also fixed some links in base template.
  • Loading branch information
javierggt committed Jul 19, 2022
1 parent 2b374e4 commit cf5a894
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 446 deletions.
8 changes: 8 additions & 0 deletions kadi_apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ def index():
)


def api_index():
"""Return main API page"""
return render_template(
'api_index.html',
)


def get_app(name=__name__, settings='devel'):
import kadi_apps
from kadi_apps.blueprints import auth, test, ska_api as api, kadi, find_attitude
Expand Down Expand Up @@ -61,6 +68,7 @@ def get_app(name=__name__, settings='devel'):
app.register_error_handler(500, internal_error)

app.add_url_rule("/", view_func=index)
app.add_url_rule("/api", view_func=api_index)

app.register_blueprint(kadi.blueprint, url_prefix='/kadi')
app.register_blueprint(find_attitude.blueprint, url_prefix='/find_attitude')
Expand Down
8 changes: 1 addition & 7 deletions kadi_apps/blueprints/ska_api/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Blueprint, render_template
from flask import Blueprint
from flask import request

import logging
Expand All @@ -20,12 +20,6 @@
blueprint = Blueprint('ska_api', __name__, template_folder='templates')


@blueprint.route("/")
def show_help():
"""Return help page for web-kadi API access"""
return render_template('help.html')


class NotFound(Exception):
pass

Expand Down
Loading

0 comments on commit cf5a894

Please sign in to comment.