"use strict";(self.webpackChunkgrpc_workshop_doc=self.webpackChunkgrpc_workshop_doc||[]).push([[1356],{3905:(e,t,r)=>{r.d(t,{Zo:()=>g,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var p=n.createContext({}),i=function(e){var t=n.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},g=function(e){var t=i(e.components);return n.createElement(p.Provider,{value:t},e.children)},l="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},y=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,g=s(e,["components","mdxType","originalType","parentName"]),l=i(r),y=a,f=l["".concat(p,".").concat(y)]||l[y]||u[y]||o;return r?n.createElement(f,c(c({ref:t},g),{},{components:r})):n.createElement(f,c({ref:t},g))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,c=new Array(o);c[0]=y;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s[l]="string"==typeof e?e:a,c[1]=s;for(var i=2;i<o;i++)c[i]=r[i];return n.createElement.apply(null,c)}return n.createElement.apply(null,r)}y.displayName="MDXCreateElement"},8067:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>c,default:()=>u,frontMatter:()=>o,metadata:()=>s,toc:()=>i});var n=r(7462),a=(r(7294),r(3905));const o={},c="grpc-gateway",s={unversionedId:"Day 2/transcoding/grpc-gateway",id:"Day 2/transcoding/grpc-gateway",title:"grpc-gateway",description:"grpc-gateway is another technology for creating RESTful JSON APIs from gRPC services. It uses the same .proto annotations to map HTTP concepts to gRPC services.",source:"@site/docs/Day 2/02-transcoding/grpc-gateway.md",sourceDirName:"Day 2/02-transcoding",slug:"/Day 2/transcoding/grpc-gateway",permalink:"/docs/Day 2/transcoding/grpc-gateway",draft:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/Day 2/02-transcoding/grpc-gateway.md",tags:[],version:"current",frontMatter:{},sidebar:"day2",previous:{title:"Transcoding",permalink:"/docs/Day 2/transcoding/"},next:{title:"grpc-web",permalink:"/docs/Day 2/transcoding/grpc-web"}},p={},i=[],g={toc:i},l="wrapper";function u(e){let{components:t,...r}=e;return(0,a.kt)(l,(0,n.Z)({},g,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"grpc-gateway"},"grpc-gateway"),(0,a.kt)("p",null,"grpc-gateway is another technology for creating RESTful JSON APIs from gRPC services. It uses the same .proto annotations to map HTTP concepts to gRPC services."),(0,a.kt)("p",null,"It uses code generation to create a reverse-proxy server, and the reverse proxy translates RESTful calls into gRPC+Protobuf and sends the calls over HTTP/2 to the gRPC service.\nThe benefit of this approach is the gRPC service doesn't know about the RESTful JSON APIs. Any gRPC server can use grpc-gateway."),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/grpc-ecosystem/grpc-gateway"},"https://github.com/grpc-ecosystem/grpc-gateway")),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://grpc-ecosystem.github.io/grpc-gateway/"},"https://grpc-ecosystem.github.io/grpc-gateway/"),"\n",(0,a.kt)("a",{parentName:"p",href:"https://blog.logrocket.com/guide-to-grpc-gateway/"},"https://blog.logrocket.com/guide-to-grpc-gateway/")))}u.isMDXComponent=!0}}]);