2441d1cf59
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>
@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}`);
});