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