Created
October 12, 2017 04:08
-
-
Save ejherran/3ef0350a6c3fac8b36ea176780300f5d to your computer and use it in GitHub Desktop.
Get Echo Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cherrypy | |
import json | |
class HelloWorld(object): | |
@cherrypy.expose | |
def index(self, data): | |
size = len(data) | |
data = json.loads(data) | |
print("\n") | |
print("==================================================================") | |
print("Token:", data['token']) | |
print("Temperatura:", data['temperatura']) | |
print("==================================================================") | |
print("\n") | |
return "OK..."+str(size)+" Bytes Recv!." | |
cherrypy.config.update({'server.socket_host': '0.0.0.0', | |
'server.socket_port': 8080, | |
}) | |
cherrypy.quickstart(HelloWorld()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment