-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathweb.py
33 lines (21 loc) · 804 Bytes
/
web.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask, render_template, request
import settings
app = Flask(__name__)
@app.route('/')
def __index():
return render_template('index.html', title='CasparCG Dashboard')
@app.route('/testclient')
def __testclient():
return render_template('testclient.html', title='CasparCG Dashboard')
@app.route('/insert/<name>/<timestamp>', methods=['GET', 'POST', 'DELETE'])
def __OTA_handler(name, timestamp):
if request.method == 'GET':
return "Get the data"
elif request.method == 'POST':
return "PUT the da"
elif request.method == 'DELETE':
return "DELETE the data"
def run_server():
app.run(port=settings.__WEBCLIENT_PORT__, host=settings.__WEBCLIENT_IP__, debug=settings.__WEBCLIENT_DEBUG__)
if __name__ == '__main__':
run_server()