import flask from flask_accept import accept import by.config as c import by.model as m @c.app.route("/p/") @accept("application/json") def page(slug: str): return flask.jsonify(m.Page.view_from_slug(slug).to_dict()) @page.support("text/html") def page_json(slug: str): return flask.redirect(f'/#{slug}') @c.app.route("/") def index(): return flask.send_file('../static/index.html')