Skip to content

Instantly share code, notes, and snippets.

@NorthIsUp
Created February 22, 2011 01:03
Show Gist options
  • Save NorthIsUp/838041 to your computer and use it in GitHub Desktop.
Save NorthIsUp/838041 to your computer and use it in GitHub Desktop.
#!/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