Multiple endpoints within one handler
I have had success creating serverless endpoints in runpod with handler.py files that look like this:
imports
...
def handler(job):
job_input = job['input']
...
return result
runpod.serverless.start({"handler": handler})
Now im trying to deploy a severless endpoint with a handler that has two individual functions instead of one.
With a traditional flask api set up, it would look like two app.routes.
I understand runpod doesnt work with flask
But if i were to want to structure a handler.py with multiple endpoints (multiple different def handler(job) methods), how would i do that?
and then how would i call those endpoints?
I would assume its like this:
https://api.runpod.ai/v2/.../runsync/<endpoint1>
https://api.runpod.ai/v2/.../runsync/<endpoint2>
Can anyone assist me in solving this problem?
imports
...
def handler(job):
job_input = job['input']
...
return result
runpod.serverless.start({"handler": handler})
Now im trying to deploy a severless endpoint with a handler that has two individual functions instead of one.
With a traditional flask api set up, it would look like two app.routes.
I understand runpod doesnt work with flask
But if i were to want to structure a handler.py with multiple endpoints (multiple different def handler(job) methods), how would i do that?
and then how would i call those endpoints?
I would assume its like this:
https://api.runpod.ai/v2/.../runsync/<endpoint1>
https://api.runpod.ai/v2/.../runsync/<endpoint2>
Can anyone assist me in solving this problem?