Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add grpc gw http listener #174

Merged
merged 1 commit into from
Sep 14, 2023
Merged

feat: add grpc gw http listener #174

merged 1 commit into from
Sep 14, 2023

Conversation

glimchb
Copy link
Member

@glimchb glimchb commented Sep 11, 2023

see https://github.com/grpc-ecosystem/grpc-gateway

testing like this:

$ docker run --rm -it -p 50051:50051 -p 8082:8082 cad70904c875
2023/09/12 01:30:20 Server listening at [::]:50051
2023/09/12 01:30:20 HTTP Server listening at 8082
...

$ curl -kL http://localhost:8082/v1
{"code":5,"message":"Not Found","details":[]}

$ curl -kL http://localhost:8082/v1/inventory/1/inventory/2
this produces full correct response

Signed-off-by: Boris Glimcher Boris.Glimcher@emc.com

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #174 (7a8ded7) into main (0ed1149) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #174   +/-   ##
=======================================
  Coverage   62.06%   62.06%           
=======================================
  Files           1        1           
  Lines          58       58           
=======================================
  Hits           36       36           
  Misses         15       15           
  Partials        7        7           

@glimchb
Copy link
Member Author

glimchb commented Sep 11, 2023

@chujieyang can you please review this one ?

@chujieyang
Copy link

@chujieyang can you please review this one ?

I agree with this.

@glimchb glimchb marked this pull request as ready for review September 12, 2023 03:16
@glimchb glimchb requested a review from a team as a code owner September 12, 2023 03:16
@glimchb
Copy link
Member Author

glimchb commented Sep 12, 2023

@chujieyang do you understand why I get this error?

$ curl -kL http://localhost:8082/v1
{"code":5,"message":"Not Found","details":[]}

is it due to wrong http annotation ?

        option (google.api.http) = {
            get: "/v1/{name=inventory/*/inventory/*}"
        };

here https://github.com/opiproject/opi-api/blob/3b18c0431f460b3e01707809d69b232465ccb917/common/v1/inventory.proto#L31

or wrong curl command ?

@chujieyang
Copy link

@chujieyang do you understand why I get this error?

$ curl -kL http://localhost:8082/v1
{"code":5,"message":"Not Found","details":[]}

is it due to wrong http annotation ?

        option (google.api.http) = {
            get: "/v1/{name=inventory/*/inventory/*}"
        };

here https://github.com/opiproject/opi-api/blob/3b18c0431f460b3e01707809d69b232465ccb917/common/v1/inventory.proto#L31

or wrong curl command ?

As the proto file define, you can use this command to test:
curl -kL http://localhost:8082/v1/inventory/1/inventory/2

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
@glimchb
Copy link
Member Author

glimchb commented Sep 12, 2023

As the proto file define, you can use this command to test: curl -kL http://localhost:8082/v1/inventory/1/inventory/2

@chujieyang thanks, this works great!

@glimchb glimchb added the Merge Candidate in the open merge window, next candidate for merge label Sep 12, 2023
@glimchb glimchb merged commit fd31461 into opiproject:main Sep 14, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merge Candidate in the open merge window, next candidate for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add grpc gw http listener
2 participants