0.4.2 • Published 8 months ago

@echolayer/plugin-backstage-backend v0.4.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
8 months ago

Installing EchoLayer Backend Plugin

  1. Install the plugin
# In Backstage root directory
yarn add --cwd packages/backend @echolayer/plugin-backstage-backend
  1. Create an echolayer.ts file in the following location in Backstage: packages/backend/src/plugins/echolayer.ts
import { CatalogClient } from "@backstage/catalog-client";
import { createScheduler } from "@echolayer/plugin-backstage-backend";
import { PluginEnvironment } from "../types";

export default async function createPlugin(env: PluginEnvironment) {
    const { logger, scheduler, tokenManager, config } = env;

    const catalogClient = new CatalogClient({
        discoveryApi: env.discovery,
    });

    await createScheduler({
        logger, scheduler, catalogClient, tokenManager, config
    });
}
  1. Update Backstage backend so it can run the EchoLayer backend plugin at packages/backend/src/index.ts
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
import { DefaultIdentityClient } from '@backstage/plugin-auth-node';

import echolayer from './plugins/echolayer';

// ...snip

async function main() {
	// ..snip
	const appEnv = useHotMemoize(module, () => createEnv('app'));
  const echolayerEnv = useHotMemoize(module, () => createEnv('echolayer'));

	const apiRouter = Router();
  // ...snip
  apiRouter.use('/proxy', await proxy(proxyEnv));
  apiRouter.use('/search', await search(searchEnv));

  // Your code to start the backend
  await service.start().catch(err => {
    console.log(err);
    process.exit(1);
  });
  
  // create the EchoLayer plugin after the backend has started
	await echolayer(echolayerEnv);

	// ...snip
  1. Update your app-config.yaml to include the following:
echolayer:
  apiKey: <your api key>

License

This plugin is licensed under the Apache 2.0 License.

The EchoLayer name and brand are copyright Codex Build Inc. 2023. They are excluded from the Apache 2.0 license.