6c91854391
An oversight that probably stems from that most repositories for tech-docs are public anyway. Ours are not, and are inside of a GitHub Enterprise, which is how i found this tiny bug. I wish i knew how to mock the cross-fetch in order to inspect the Authorization header of the request to test this fix. I can only confirm that it works on our backstage that targets GHE.
@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}`);
});