mirror of
https://github.com/fergalmoran/buttcord.git
synced 2025-12-22 09:27:34 +00:00
15Mar
This commit is contained in:
16
server.py
16
server.py
@@ -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)
|
||||||
|
|||||||
@@ -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!
|
||||||
|
|||||||
Reference in New Issue
Block a user