Files
backstage/plugins/bazaar-backend
Andre Wanlin b7de76ae72 Introduced version policy for PostgreSQL
Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Added changeset

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated API Report

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated references to use 12 and 16

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Attempt to fix tests

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Added back old Ids

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixed test

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated API Report and test

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Added new setDefaults static method and related changes

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated API Report

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Improved logic based on feedback

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Added missing changeset

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Changes based on feedback

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

API Report correction

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated to use new setDefaults

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2023-12-15 12:27:51 -06:00
..
2023-12-12 15:45:17 +00:00
2023-12-12 15:45:17 +00:00

Bazaar Backend

Welcome to the Bazaar backend plugin!

Installation

Install the package

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

Adding the plugin to your packages/backend

You'll need to add the plugin to the router in your backend package. You can do this by creating a file called packages/backend/src/plugins/bazaar.ts

import { PluginEnvironment } from '../types';
import { createRouter } from '@backstage/plugin-bazaar-backend';
import { Router } from 'express';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  return await createRouter({
    logger: env.logger,
    config: env.config,
    database: env.database,
    identity: env.identity,
  });
}

With the bazaar.ts router setup in place, add the router to packages/backend/src/index.ts:

+ import bazaar from './plugins/bazaar';

async function main() {
  ...
  const createEnv = makeCreateEnv(config);

  const catalogEnv = useHotMemoize(module, () => createEnv('catalog'));
+    const bazaarEnv = useHotMemoize(module, () => createEnv('bazaar'));

  const apiRouter = Router();
+  apiRouter.use('/bazaar', await bazaar(bazaarEnv));
  ...
  apiRouter.use(notFoundHandler());