This commit is contained in:
Fergal Moran
2021-03-15 20:12:59 +00:00
parent 607af5b4d4
commit a67cdd2c60
2 changed files with 24 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
from flask import Flask, render_template from flask import Flask, render_template, jsonify
app = Flask(__name__) app = Flask(__name__)
@@ -12,4 +12,18 @@ def index():
def test(): def test():
return render_template('test.html') return render_template('test.html')
@app.route('/api/servers')
def get_servers():
servers = [
{'name': 'server1', 'description': 'My number 1 server',
'image': 'http://placebeard.it/64/64?beard=1'},
{'name': 'server2', 'description': 'My number 2 server',
'image': 'http://placebeard.it/64/64?beard=2'},
{'name': 'server3', 'description': 'My number 3 server',
'image': 'http://placebeard.it/64/64?beard=3'},
]
return jsonify(servers)
app.run(debug=True) app.run(debug=True)

View File

@@ -43,6 +43,15 @@
{% block scripts %} {% block scripts %}
<script> <script>
document.addEventListener('DOMContentLoaded', function () {
});
document.addEventListener('mousedown', function (event) {
console.log('index', 'mousedownX', event.clientX);
console.log('index', 'mousedownY', event.clientY);
});
function selectMe(event) { function selectMe(event) {
//this is the wrong way //this is the wrong way
//later, we will figure out why! //later, we will figure out why!