Welcome to the Statuspage backend plugin!
The plugin retrieves component status information the statuspage.io api.
The following sections will help you get the Readme Backend plugin setup and running.
Install the plugin by following the example below:
# From your Backstage root directory
yarn --cwd packages/backend add @axis-backstage/plugin-statuspage-backend
Here's how to get the backend plugin up and running:
-
Create a new file named
packages/backend/src/plugins/statuspage.ts
, and add the following to it:import { PluginEnvironment } from '../types'; import { createRouter } from '@axis-backstage/plugin-statuspage-backend'; import { Router } from 'express'; export default async function createPlugin( env: PluginEnvironment, ): Promise<Router> { return await createRouter({ logger: env.logger, config: env.config, }); }
-
Wire this into the overall backend router by adding the following to
packages/backend/src/index.ts
:import statuspage from './plugins/statuspage'; ... async function main() { // Add this line under the other lines that follow the useHotMemoize pattern const statuspageEnv = useHotMemoize(module, () => createEnv('statuspage')); .... // Add this under the lines that add their routers to apiRouter apiRouter.use('/statuspage', authMiddleware, await statuspage(statuspageEnv)); }