|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
# Flask application to serve the web pages
|
|
|
|
|
from flask import Flask, request, redirect, url_for, jsonify, render_template
|
|
|
|
|
from flask_cors import CORS
|
|
|
|
|
|
|
|
|
|
# Mediawiki client to interact with the Wiki
|
|
|
|
|
import mwclient
|
|
|
|
@ -42,7 +41,6 @@ class PrefixMiddleware(object):
|
|
|
|
|
|
|
|
|
|
# create flask application
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
CORS(app)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Url prefix for the soupboat and port
|
|
|
|
@ -119,12 +117,13 @@ def api():
|
|
|
|
|
add_pad(link, title, overview, categories, date)
|
|
|
|
|
redirect(url_for('home'))
|
|
|
|
|
|
|
|
|
|
response = {
|
|
|
|
|
response = jsonify({
|
|
|
|
|
'page': padliography,
|
|
|
|
|
'pads': get_pads()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
response.headers.add('Access-Control-Allow-Origin', '*')
|
|
|
|
|
|
|
|
|
|
return jsonify(response)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.run(port=port)
|
|
|
|
|