Created
February 22, 2011 01:03
-
-
Save NorthIsUp/838041 to your computer and use it in GitHub Desktop.
This file contains 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 cherrypy | |
print cherrypy.__version__ | |
class Root: | |
@cherrypy.expose | |
def index(self): | |
return "Hello world" | |
@cherrypy.expose | |
def default(self): | |
"""docstring for default""" | |
return "default page" | |
def _cp_dispatch(self, *args, **kw): | |
vpath = kw['vpath'] | |
print "v>", vpath | |
return self.default | |
cherrypy.quickstart(Root()) | |
# works for: | |
# http://localhost:8080/foo/ | |
# 404 for: | |
# http://localhost:8080/foo/bar/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment