599f3dfa83
Bumps [@types/concat-stream](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/concat-stream) from 1.6.1 to 2.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/concat-stream) --- updated-dependencies: - dependency-name: "@types/concat-stream" dependency-type: direct:development 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}`);
});