joxeankoret icon

Untitled

joxeankoret | PRO | 11/25/18 10:31:38 AM UTC | 0 ⭐ | 392 👁️ | Never ⏰ | []
Python |

300 B

|

None

|

0 👍

/

0 👎

import web
import json
    
urls = (
  '/(.*)', 'hello'
)
app = web.application(urls, globals())
 
class hello:    
  def GET(self, name):
    d = {}
    if not name: 
      d["name"] = 'World'
    else:
      d["name"] = name
    return json.dumps(d)
 
if __name__ == "__main__":
  app.run()

Comments