# @adamlonsdale/backstage-plugin-armorcode-backend

> Welcome to the backstage-plugin-armorcode-backend backend plugin!

Latest version **0.0.4** (published 2023-04-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @adamlonsdale/backstage-plugin-armorcode-backend
pnpm add @adamlonsdale/backstage-plugin-armorcode-backend
yarn add @adamlonsdale/backstage-plugin-armorcode-backend
bun add @adamlonsdale/backstage-plugin-armorcode-backend
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2023-04-23 |
| First published | 2023-03-18 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 227.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | adamlonsdale |
| Keywords | Armorcode, Vulnerability, Backstage |

## Links

- npm: https://www.npmjs.com/package/@adamlonsdale/backstage-plugin-armorcode-backend
- Repository: https://github.com/adamlonsdale/backstage-plugin-armorcode-backend
- Issues: https://github.com/adamlonsdale/backstage-plugin-armorcode-backend/issues
- npm.io page: https://npm.io/package/@adamlonsdale/backstage-plugin-armorcode-backend

## Dependencies (8)

- [yn](https://npm.io/package/yn.md) ^4.0.0
- [express](https://npm.io/package/express.md) ^4.18.1
- [winston](https://npm.io/package/winston.md) ^3.2.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.7
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.13
- [@backstage/config](https://npm.io/package/@backstage/config.md) ^1.0.4
- [express-promise-router](https://npm.io/package/express-promise-router.md) ^4.1.0
- [@backstage/backend-common](https://npm.io/package/@backstage/backend-common.md) ^0.16.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2023-04-23
- 0.0.1-alpha — 2023-03-18

## README

# backstage-plugin-armorcode-backend

Welcome to the backstage-plugin-armorcode-backend backend plugin!


## Getting started

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

```bash
# From your Backstage root directory
yarn add --cwd packages/backend @adamlonsdale/backstage-plugin-armorcode-backend
```

Create a file called armorcode.ts inside `packages/backend/src/plugins/` and add the following:

### armorcode.ts
```typescript
import { createRouter } from '@adamlonsdale/backstage-plugin-armorcode-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

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

And import the plugin to `packages/backend/src/index.ts`.
### src/index.ts
```diff
diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts
index c4736a5..5822302 100644
--- a/packages/backend/src/index.ts
+++ b/packages/backend/src/index.ts
@@ -28,6 +28,7 @@ import scaffolder from './plugins/scaffolder';
 import proxy from './plugins/proxy';
 import techdocs from './plugins/techdocs';
 import search from './plugins/search';
+import armorcode from './plugins/armorcode';
 import { PluginEnvironment } from './types';
 import { ServerPermissionClient } from '@backstage/plugin-permission-node';
 import { DefaultIdentityClient } from '@backstage/plugin-auth-node';
@@ -85,6 +86,7 @@ async function main() {
   const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs'));
   const searchEnv = useHotMemoize(module, () => createEnv('search'));
   const appEnv = useHotMemoize(module, () => createEnv('app'));
+  const armorocdeEnv = useHotMemoize(module, () => createEnv('armorocde'));

   const apiRouter = Router();
   apiRouter.use('/catalog', await catalog(catalogEnv));
@@ -93,6 +95,7 @@ async function main() {
   apiRouter.use('/techdocs', await techdocs(techdocsEnv));
   apiRouter.use('/proxy', await proxy(proxyEnv));
   apiRouter.use('/search', await search(searchEnv));
+  apiRouter.use('/armorcode', await armorcode(armorcodeEnv));

   // Add backends ABOVE this line; this 404 handler is the catch-all fallback
   apiRouter.use(notFoundHandler());

```

## Configuration

Add the following into your `app-config.yaml`
### Config
```yaml
armorcode:
  host: https://app.armorocde.com
  token: YOUR_API_TOKEN
```

Add the following into your catalog
### Catalog
```yaml
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: backstage
  annotations:
    armorcode/project: YOUR_PROJECT_NAME/YOUR_PROJECT_VERSION
```

---
_Source: https://npm.io/package/@adamlonsdale/backstage-plugin-armorcode-backend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
