Giter Club home page Giter Club logo

grpc-gw's Introduction

gRPC-gw

gRPC-gw is a simple go gRPC server with support for REST API

Steps to run the application

  • Build from source
    # download the dependencies
    go mod dowload
    # build the binary
    go build main.go -o app
    # execution permission to the binary
    chmod +x ./app
    # run the application
    ./app
  • Using Docker
    # build the docker image
    docker build -t app:latest -f Dockerfile .
    # run the container
    docker run --rm -d -p 8080:8080 -p 8081:8081 --name app app:latest

Steps to use the application

As the application features gRPC gateway, the services can be accessible by both using and rpc client and also using an REST API client.

  • Using curl
 curl -X POST -k http://localhost:8081/v1/user/fetchByID -d '{"id":2}'

or

 curl -X POST -k http://localhost:8081/v1/user/fetch -d '{"id":[1,2]}'
  • You can also use a rpc client to use the service. You can use the proto files to create a client or any cli can be used to connect with the server
  • You can also use cli like evans in order to use the rpc server.

grpc-gw's People

Contributors

aka-achu avatar

Watchers

 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.