Search code examples
node.jstypescriptjson-rpcnestjs

Nest.JS JSON RPC Support


I'm looking into using Nest.JS for a project, but a key requirement for my project means I have to provide a JSON-RPC API as well as the usual HTTP/Socket.io API.

Wondered if that was supported. Apparently this is the best place to ask.


Solution

  • Nest does support gRPC out of the box, you can read about it here https://docs.nestjs.com/microservices/grpc but not JSON-RPC, and Im not sure if this is exposed, so basically answering to your first part of question: Nope, there is no support for JSON-RPC in nest out of the box. But the second one, the answer is: yes, you can map your controller methods to the socket/http request.