Last active
September 28, 2015 04:14
-
-
Save dloman/77ab4695cbd9d7f9acff to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python | |
import web | |
import json | |
urls = ('/(.*)', 'hello') | |
app = web.application(urls, globals()) | |
############################################################################### | |
############################################################################### | |
class hello: | |
def POST(*args,**kwargs): | |
Data = web.input() | |
print "Post" | |
print Data | |
def GET(*args, **kwargs): | |
Data = web.input() | |
print "Get" | |
print Data | |
web.header('Content-Type', 'application/json') | |
return json.dumps({'lights': False}, indent=2) | |
############################################################################### | |
############################################################################### | |
if __name__ == "__main__": | |
web.config.debug = False | |
try: | |
app.run() | |
except: | |
print 'webpy didnt work' | |
exit() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment