Advertisement
joxeankoret

Untitled

Nov 25th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import web
  2. import json
  3.    
  4. urls = (
  5.   '/(.*)', 'hello'
  6. )
  7. app = web.application(urls, globals())
  8.  
  9. class hello:    
  10.   def GET(self, name):
  11.     d = {}
  12.     if not name:
  13.       d["name"] = 'World'
  14.     else:
  15.       d["name"] = name
  16.     return json.dumps(d)
  17.  
  18. if __name__ == "__main__":
  19.   app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement