Giter Site home page Giter Site logo

grpc-service's Introduction

gRPC Service

This project includes both server and client for a simple note service which uses gRPC framework.

Run Server

Runing the command below will start the server in localhost with the port 50051.

npm run start

Make Request

Example commands below will give you the idea on how to make request to gRPC server.

npm run client list
npm run client get --id '1A'
npm run client update --id '1A' --title 'Test' --content 'Test Content'
npm run client watch

Add New Service

gRPC services are defined as .proto files in /protos dir. You can add new services under this dir. They are all exported in /protos/index.js

To register handlers for the gRPC service methods defined in your .proto file, you should add your handlers under /server/handlers/ dir(see note.js for guiding) and export your handlers in /server/handlers/index.js

Finally, you should import your handlers in /server/index.js and call addService method on server object like below:

server.addService(yournewservice.YourNewService.service, yourNewHandlers);

grpc-service's People

Watchers

Ömer Furkan Gençer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.