npt
npt

Reputation: 173

CherryPy: using RoutesDispatcher plus an alternate dispatcher for cpstats

I'd like to use cpstats (http://www.cherrypy.org/browser/trunk/py3/cherrypy/lib/cpstats.py) in an application already entirely based on RoutesDispatcher. How can I either:

  1. have RoutesDispatcher route to cpstats, or
  2. use both RoutesDispatcher and the ordinary dispatcher in the same tree, with the latter running only cpstats?

Upvotes: 0

Views: 413

Answers (1)

fumanchu
fumanchu

Reputation: 14559

You can write in your config:

[/stats]
request.dispatch = cherrypy.dispatch.Dispatcher()

...to use the default dispatcher for that URI.

Upvotes: 1

Related Questions