ff0f7f89a2
* 'master' of github.com:backstage/backstage: (269 commits) address comments catalog-backend: flesh out and tweak the config schema Update chilled-pigs-destroy.md catalog-backend: start warning about usage of deprecated location types scripts: add script for migrating away from deprecated location types chore: fixing changeset prettyness Create good-hairs-sniff.md Update IconLinkVertical.tsx Update violet-sloths-reply.md Delete fuzzy-windows-cry.md Create violet-sloths-reply.md Added changeset build(deps): bump archiver from 5.0.2 to 5.1.0 build(deps): bump typescript-json-schema from 0.45.0 to 0.45.1 docs: Update lighthouse docs fix(app): listen to app.listen.host scaffolder-backend: clarify type detection error message docs: Update techdocs architecture features status scaffolder-backend: gitlab preparer uses integrations token core-api: ensure that routable extension components are discovered at boot ...
@backstage/backend-common
Common functionality library for Backstage backends, implementing logging, error handling and similar.
Usage
Add the library to your backend package:
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}`);
});