Search code examples
javascriptnode.jsexpressgrpcgrpc-node

Can grpc and express server run by same nodejs server, or grpc has to be different server


I am trying to create a REST server which will be based on Node/Express. How to add a GRPC server in the same REST server, or it has to be completely different NodeJS server which will host only the GRPC server.


Solution

  • You cannot add a gRPC server to an Express server. You can run a gRPC server in the same process as an Express server, but they will serve on separate ports and run independently.