This package has been deprecated

Author message:

This package is deprecated, please follow the deprecation instructions for the exports you still use

@backstage/backend-common
TypeScript icon, indicating that this package has built-in type declarations

0.25.0 • Public • Published

@backstage/backend-common

[!CAUTION] This package is deprecated and will be removed in a near future, so please follow the deprecated instructions for the exports you still use.

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
yarn --cwd packages/backend 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

Readme

Keywords

Package Sidebar

Install

npm i @backstage/backend-common

Homepage

backstage.io

Weekly Downloads

4,057,170

Version

0.25.0

License

Apache-2.0

Unpacked Size

664 kB

Total Files

15

Last publish

Collaborators

  • patriko
  • freben
  • marcuseide