Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backstage-grpc-playground-backend

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backstage-grpc-playground-backend

A backend plugin for Backstage supporting gRPC playground

  • 0.1.3-next.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
184
decreased by-32.6%
Maintainers
1
Weekly downloads
 
Created
Source

backstage-grpc-playground-backend

GitHub Project Level GitHub issues GitHub contributors GitHub code size in bytes

  • Overview
  • Install
  • Usage
  • Acknowledgements

Overview

This repo contains backend code of the backstage-grpc-playground

Install

Install backstage-grpc-playground-backend for packages/backend

E.g: In your backstage project root

  yarn --cwd packages/backend add backstage-grpc-playground-backend

Usage

Register the plugin in backend

Create a new file packages/backend/src/plugins/grpc-playground.ts

// packages/backend/src/plugins/grpc-playground.ts
import { ScmIntegrations } from '@backstage/integration';
import { createRouter } from 'backstage-grpc-playground-backend';

import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  const { config, reader } = env;

  const integrations = ScmIntegrations.fromConfig(config);

  return await createRouter({
    logger: env.logger,
    reader,
    integrations,
  });
}
Register /grpc-playground path in backstage backend
// packages/backend/src/index.ts
import grpcPlayground from './plugins/grpc-playground';

async function main() {
  // other env
  const grpcPlaygroundEnv = useHotMemoize(module, () => createEnv('grpc-playground'));
  
  // init router
  // ...

  // register before notFoundHandler  
  apiRouter.use('/grpc-playground', await grpcPlayground(grpcPlaygroundEnv));

  // not found handler
  apiRouter.use(notFoundHandler());
}

Examples

See examples

Acknowledgements

Keywords

FAQs

Package last updated on 01 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc