Skip to content

Instantly share code, notes, and snippets.

@dloman
Last active September 28, 2015 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dloman/77ab4695cbd9d7f9acff to your computer and use it in GitHub Desktop.
Save dloman/77ab4695cbd9d7f9acff to your computer and use it in GitHub Desktop.
#!/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