New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@philips-software/backstage-plugin-upptime-backend

Package Overview
Dependencies
Maintainers
11
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@philips-software/backstage-plugin-upptime-backend

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created
Source

Upptime Backend

Welcome to the upptime-backend backend plugin!

Integrating into a backstage instance

This plugin needs to be added to an existing backstage instance.

# From your Backstage root directory
yarn add --cwd packages/backend @backstage/plugin-upptime-backend

Typically, this means creating a src/plugins/upptime.ts file and adding a reference to it to src/index.ts in the backend package.

upptime.ts

import { createRouter } from '@internal/plugin-upptime-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import { CatalogClient } from '@backstage/catalog-client';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  const catalogClient = new CatalogClient({
    discoveryApi: env.discovery,
  });

  return await createRouter({
    logger: env.logger,
    catalog: catalogClient,
    config: env.config,
    reader: env.reader,
  });
}

src/index.ts

diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts
index 1942c36ad1..7fdc48ba24 100644
--- a/packages/backend/src/index.ts
+++ b/packages/backend/src/index.ts
@@ -50,6 +50,7 @@ import scaffolder from './plugins/scaffolder';
 import proxy from './plugins/proxy';
 import search from './plugins/search';
 import techdocs from './plugins/techdocs';
+import upptime from './plugins/upptime';
 import techInsights from './plugins/techInsights';
 import todo from './plugins/todo';
 import graphql from './plugins/graphql';
@@ -133,6 +134,7 @@ async function main() {
     createEnv('tech-insights'),
   );
   const permissionEnv = useHotMemoize(module, () => createEnv('permission'));
+  const upptimeEnv = useHotMemoize(module, () => createEnv('upptime'));

   const apiRouter = Router();
   apiRouter.use('/catalog', await catalog(catalogEnv));
@@ -152,6 +154,7 @@ async function main() {
   apiRouter.use('/badges', await badges(badgesEnv));
   apiRouter.use('/jenkins', await jenkins(jenkinsEnv));
   apiRouter.use('/permission', await permission(permissionEnv));
+  apiRouter.use('/upptime', await upptime(upptimeEnv));
   apiRouter.use(notFoundHandler());

   const service = createServiceBuilder(module)

Configuration

This plugin allows configuration of either a single or multiple global Upptime repository instances and annotating entities with the instance name. This instance name in the entities is optional, if not provided the default instance in configuration will be used. That allow to keep configuration from before multiple instances capability to keep working without changes.

Example - Single global instance

Config

upptime:
  locations:
    default:
      url: https://github.com/upptime/upptime/

Catalog file

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: backstage
  annotations:
    upptime.js.org/key: YOUR_PROJECT_KEY
Example - Multiple global instance

The following will look for status at https://github.com/your-otg/status/ for the project of key specialProject.

Config

upptime:
  instances:
    default:
      url: https://github.com/upptime/upptime/
    specialProject:
      url: https://github.com/your-otg/status

Catalog file

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: backstage
  annotations:
    upptime.js.org/key: specialProject/YOUR_PROJECT_KEY

If the specialProject/ part is omitted (or replaced with default/), the instance of name default will be used.

  • Upptime Frontend

FAQs

Package last updated on 25 Apr 2024

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