I have a WEB application with some static WEB page (the documentation). I'd like the documentation (written in html) to be accessible from the application running under cherrypy, but also as static files that we can open without running the WEB server ...
class AppServer( JFlowServer ):
@cherrypy.expose
def index(self, **kwargs):
return " ".join( open(os.path.join(WEB_DIR, "index.html" )).readlines() )
@cherrypy.expose
def test(self, **kwargs):
return " ".join( open(os.path.join(WEB_DIR, "test.html" )).readlines() )
this works fine, but as I do have multiple pages, from cherrypy the link should be "/test" where in the static mode I have "/test.html". I wanted to make cherrypy maps the URL but I couldn't find a way to do so ...
thanks for your help, Jerome
You can achieve it with
staticdir
tool and using relative URLs in your documentation. The latter will allso access from both http:// and file:// protocols.Here's how it can look like.
app.py
docs/index.html
docs/a.html
docs/b.html