master
km0 2 years ago
parent df29593254
commit 23c03069f4

@ -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)

@ -8,7 +8,6 @@ setup(
zip_safe=False,
install_requires=[
'flask',
'flask_cors',
'bs4',
'mwclient',
'python-dotenv',

@ -16,8 +16,8 @@
</div>
<script type="module">
import PadForm from "{{url_for('static', filename='js/components/PadForm.js')}}";
import PadTable from "{{url_for('static', filename='js/components/PadTable.js')}}";
import PadForm from "{{url_for('static', filename='js/PadForm.js')}}";
import PadTable from "{{url_for('static', filename='js/PadTable.js')}}";
const { createApp } = Vue;

Loading…
Cancel
Save