-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebserv.py
More file actions
53 lines (33 loc) · 773 Bytes
/
webserv.py
File metadata and controls
53 lines (33 loc) · 773 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Rowan D'Ausilio
LED Lightstrip project
"""
from flask import Flask, render_template, jsonify
from pick_color import Color_Picker
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/red')
def red():
return jsonify(237, 28, 28, 0)
@app.route('/orange')
def orange():
return jsonify(255, 126, 28, 0)
@app.route('/yellow')
def yellow():
return jsonify(255, 228, 28, 0)
@app.route('/green')
def green():
return jsonify(42, 178, 37, 0)
@app.route('/blue')
def blue():
return jsonify(24, 86, 178, 0)
@app.route('/purple')
def purple():
return jsonify(128, 18, 165, 0)
@app.route('/custom')
def custom():
pass
if __name__ == "__main__":
app.run(host="0.0.0.0", port=4000)