excise niggabit's solution for now

pull/21/head
Aevann1 2022-11-26 23:04:39 +02:00
parent 0ff034b01b
commit 155a5b40c9
5 changed files with 21 additions and 23 deletions

View File

@ -20,7 +20,7 @@ from files.routes.jinja2 import *
from .admin import *
from .comments import *
from .errors import *
from .api import *
from .docs import *
from .reporting import *
from .front import *
from .login import *

View File

@ -1,21 +0,0 @@
import xml.etree.ElementTree as ET
from flask import render_template
from files.routes.wrappers import auth_required, auth_desired
from files.__main__ import app
tree = ET.parse('docs/api.xml')
@app.get("/api")
@auth_required
def api(v):
return render_template("api.html", v=v)
@app.get("/api/docs")
@auth_desired
def get_docs_page(v):
# TODO cache
root = tree.getroot()
return render_template("docs.html", root=tree.getroot(), v=v)

View File

@ -0,0 +1,13 @@
import xml
import xml.etree.ElementTree as ET
from files.__main__ import app, cache, limiter
tree = ET.parse('docs/api.xml')
@app.get("/dev/api")
@auth_desired
def get_docs_page():
# TODO cache
root = tree.getroot()
return render_template("docs.html", root=tree.getroot())

View File

@ -188,6 +188,11 @@ def log_item(id, v):
def static_megathread_index(v:User):
return render_template("megathread_index.html", v=v)
@app.get("/api")
@auth_required
def api(v):
return render_template("api.html", v=v)
@app.get("/contact")
@app.get("/contactus")
@app.get("/contact_us")

View File

@ -41,7 +41,8 @@
used to it</em></p>
<p>You're probably here because you want to create your own application
which calls our REST api.</p>
which calls our REST api. Some of the stuff you see here might seem
ugly (it is), but it's mainly inherited from the old Ruqqus API.</p>
<p><em class="text-info">This documentation is generated from an XML WADL file.</em></p>