Suppose I have a web application named "/my/api", with a dispatch class configured (a subclass of %CSP.REST), and I want to be able to respond to:
by loading an object with the specified ID and returning it as JSON
by returning the contents of a file (data.js) in a configured location in the filesystem, ideally based on the "CSP files phsyical path" for /my/api. (The thought is that at some point in the future the dispatch class might change to do something more complicated server-side, and that it would be nice for such a change to simply be a matter of code rather than system configuration.)
Does anyone know of a simple, maintainable way to do this in a %CSP.REST subclass, perhaps using %CSP.StreamServer? To keep configuration simple, I'd prefer to have it managed within the dispatch class rather than configuring multiple web applications. There are many different routes of both types under /my/api/, and really the default should be to look for a static file unless some other method is configured to handle the route.
Thanks in advance!