backstage-grpc-playground
Overview
backstage-grpc-playground is a backstage plugin ported from BloomRPC which is an Electron application. We modified some of the original code to make this compatible with Backstage entity. See Compare to BloomRPC
This repo contains React frontend plugin. For the backend plugin, please checkout backstage-grpc-playground-backend
Changelog
View Full changelog
Requirements
- Backstage ^1.5.0
- Node.JS 14 | 16
Methods supported
- Unary
- Client streaming
- Server streaming
Not supported (yet)
We are currently not supporting
Install
Install backstage-grpc-playground for packages/app
E.g: In your backstage project root
yarn --cwd packages/app add backstage-grpc-playground
Usage
Customize ApiDoc to use backstage-grpc-playground for grpc
type
import { GrpcPlaygroundComponent } from 'backstage-grpc-playground';
export const apis: AnyApiFactory[] = [
createApiFactory({
api: apiDocsConfigRef,
deps: {},
factory: () => {
const definitionWidgets = defaultDefinitionWidgets();
return {
getApiDefinitionWidget: (apiEntity: ApiEntity) => {
if (apiEntity.spec.type === 'grpc') {
return {
type: 'grpc',
title: 'gRPC Playground',
component: GrpcPlaygroundComponent
}
}
return definitionWidgets.find(d => d.type === apiEntity.spec.type);
},
};
},
}),
]
A path /grpc-playground
in backstage application
import { GrpcPlaygroundPage } from 'backstage-grpc-playground'
const routes = (
<FlatRoutes>
// other routes
// ...
<Route path="/grpc-playground" element={<GrpcPlaygroundPage />} />
</FlatRoutes>
);
Example importing API definition from Github examples/yaml-definition/unary.yaml
Compare to BloomRPC
Yaml file definition
See yaml-definition
Examples
View document
See example
Unary
See example
Stream
See example
Acknowledgements