diff --git a/pad-bis.py b/pad-bis.py index ec267d0..3188164 100644 --- a/pad-bis.py +++ b/pad-bis.py @@ -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) diff --git a/setup.py b/setup.py index e2e1018..7b5b179 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,6 @@ setup( zip_safe=False, install_requires=[ 'flask', - 'flask_cors', 'bs4', 'mwclient', 'python-dotenv', diff --git a/static/js/components/PadForm.js b/static/js/PadForm.js similarity index 100% rename from static/js/components/PadForm.js rename to static/js/PadForm.js diff --git a/static/js/components/PadTable.js b/static/js/PadTable.js similarity index 100% rename from static/js/components/PadTable.js rename to static/js/PadTable.js diff --git a/templates/home.html b/templates/home.html index a8672e0..cdf606c 100644 --- a/templates/home.html +++ b/templates/home.html @@ -16,8 +16,8 @@