Last active
September 27, 2017 16:09
-
-
Save edwardfung123/c052254b46f267e3e103658ed49c9af7 to your computer and use it in GitHub Desktop.
a simple app described in https://www.facebook.com/groups/gcpughk/permalink/1856928067665842/
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
| runtime: python27 | |
| api_version: 1 | |
| threadsafe: true | |
| handlers: | |
| - url: / | |
| script: main.app | |
| - url: /(.*) | |
| script: main.app |
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 | |
| # -*- coding: utf-8 -*- | |
| import webapp2 | |
| class Handler(webapp2.RequestHandler): | |
| def get(self, num=None): | |
| if num is None: | |
| self.response.write('There is nothing here...') | |
| else: | |
| self.response.write('{}'.format(num)) | |
| # see http://webapp2.readthedocs.io/en/latest/guide/routing.html | |
| app = webapp2.WSGIApplication([ | |
| webapp2.Route(r'/', Handler), | |
| webapp2.Route(r'/<num:\d+>', Handler), | |
| ], debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment