nbox.nbxlib.serving
NBX Operator Serving
This file has all the functions on how the serving of an Operator works, it also acts as the default code that runs on NBX Deploy service.
If you find yourself using this reach out to NimbleBox support.
Functions
- op_or_app -
The operator or FastAPI app to serve.
- host -
The host to serve on.
- port -
The port to serve on.
Serve an operator or a FastAPI app on a given host and port.
To keep seperation of responsibility the paths are scoped out like all the functions are in the /method_{...}
and all the custom python code is in /nbx_py_rpc
- fn -
function to be used as a fastapi route
- _rest -
if the function is a REST endpoint. Defaults to False.
This function is used to generate a fastapi route for a given function, it will take in a function and return a function that can be used as a fastapi route
Returns:
Callable
: a function that can be used as a fastapi route