Files
backstage/packages/backend-common
dependabot[bot] 0107c9aa08 chore(deps): bump helmet from 4.4.1 to 5.0.2
Bumps [helmet](https://github.com/helmetjs/helmet) from 4.4.1 to 5.0.2.
- [Release notes](https://github.com/helmetjs/helmet/releases)
- [Changelog](https://github.com/helmetjs/helmet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/helmetjs/helmet/compare/v4.4.1...v5.0.2)

---
updated-dependencies:
- dependency-name: helmet
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-16 22:50:06 +01:00
..
2022-02-07 15:51:58 +01:00
2022-02-10 11:06:33 +00:00

@backstage/backend-common

Common functionality library for Backstage backends, implementing logging, error handling and similar.

Usage

Add the library to your backend package:

# From your Backstage root directory
cd packages/backend
yarn add @backstage/backend-common

then make use of the handlers and logger as necessary:

import {
  errorHandler,
  getRootLogger,
  notFoundHandler,
  requestLoggingHandler,
} from '@backstage/backend-common';

const app = express();
app.use(requestLoggingHandler());
app.use('/home', myHomeRouter);
app.use(notFoundHandler());
app.use(errorHandler());

app.listen(PORT, () => {
  getRootLogger().info(`Listening on port ${PORT}`);
});

Documentation