registerOpdefPath("/opdef", "server_name", port="")
When the server receives a request whose path starts with prefix
, the server will respond with the corresponding opdef section data. The port
can be optionally specified if the handler should run off a port other than the main server port.
Call this function before you call /hom/hou/run.html, not from a URL handler.
For example, if you do this:
hou.registerOpdefPath("/opdef")
…and the client requests this server path:
/opdef/obj/geo?Help
…then the server will automatically serve the section Help
from the geo
node.
Note
If a URL handler has a URL more specific (matches more path parts) than the opdef path prefix, the server will use the handler instead of opdef lookup.
For example, even if you registered the opdef from above, if the client requested /opdef/geo/foo.bgeo
and you have a dynamic handler for /opdef/geo
, the server would use the handler instead of using the opdef handler.
This might be useful if you need a few dynamically generated opdef handlers mixed in with the static opdef handler. However, it’s usually best to avoid the confusion and keep opdef resources separate from dynamic resources, such as by using the default /opdef
prefix for opdef section requests.
See also |