-
Notifications
You must be signed in to change notification settings - Fork 0
/
webserver_old.py
44 lines (44 loc) · 1 KB
/
webserver_old.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
34
35
36
37
38
39
40
41
42
43
44
# #import falcon
# from procbridge import *
#
# # MARK - hardware_server procbridge settings
# host = '192.168.0.125' # put correct ip of pi
# port = 9009
# client = Client(host, port)
#
#
# # MARK - falcon server handler code
#
# class MoveHandler(object):
#
# def on_post(self, req, resp):
# cmd = req.params[0]
# p1 = req.params[1]
# print('cmd is: %s' % cmd)
# print('param1 is: %s' % p1)
# try:
# client.request(cmd, p1)
# resp.status = falcon.HTTP_200
# resp.body = 'Command received: cmd: %s' % (cmd)
# except TimeoutError:
# resp.status = falcon.HTTP_500
#
# # try:
# # client.request(cmd, param1)
# # except Exception as e:
# # success = "Failed: " + str(e)
#
#
# # app = falcon.API()
#
#
# def start():
# pass
# # app.add_route('/move', MoveHandler)
#
#
# if __name__ == '__main__':
# try:
# start()
# except KeyboardInterrupt:
# print("Stopping webserver")