Serverless handler on Nodejs
Hi. I see there is official SDK for serverless handler, but for Python. I don't see any API for handler in js-sdk.
4 Replies
That's correct. You write the serverless handler in Python.
still, is it possible to use nodejs? I'm not familiar with internal implementation of runpod serverless handler
It is. The thing running on the serverless can be whatever you want. You just have to expose it to the RunPod via the handler function in the Python script. The minimal code required is:
You can then connect your Nodejs code for example via HTTP API - by running a local server and sending internal requests to it from the Python script:
Or by spawning a subprocess
Other methods like Pipes, WebSockets, PubSub or direct TCP exist, but the communication method depends on your needs.
thank you for the example!