Files
backstage/packages/backend-common
dependabot[bot] 2441d1cf59 chore(deps): bump knex from 0.95.6 to 1.0.2
Bumps [knex](https://github.com/knex/knex) from 0.95.6 to 1.0.2.
- [Release notes](https://github.com/knex/knex/releases)
- [Changelog](https://github.com/knex/knex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/knex/knex/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 15:51:55 +01:00
..
2022-01-24 16:28:46 +01:00
2022-01-24 16:28:46 +01:00
2022-02-03 09:42:25 +00:00
2021-05-02 22:13:05 +02: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