Files
backstage/packages/backend-common
Sebastian Qvarfordt b570f78e22 Use resource instead of source when building github repo tar url (#3552)
* Use resource instead of source when building github repo tar url

* Changed the right part of the url...

* Added test to make sure we include subdomains in githubs readtree

* Fixed wopsie
2020-12-03 16:24:29 +01:00
..
2020-11-27 12:51:09 +00:00
2020-11-27 12:51:09 +00:00
2020-11-03 11:03:49 +01:00

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

Documentation