remove usages of some backend-common helpers

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-12-21 19:54:17 +01:00
parent 46c2f6eda2
commit d9d62ef90c
20 changed files with 77 additions and 39 deletions
@@ -20,7 +20,6 @@ import {
startTestBackend,
} from '@backstage/backend-test-utils';
import { appPlugin } from './appPlugin';
import { createRootLogger } from '@backstage/backend-common';
import { overridePackagePathResolution } from '@backstage/backend-plugin-api/testUtils';
const mockDir = createMockDirectory();
@@ -29,9 +28,6 @@ overridePackagePathResolution({
path: mockDir.path,
});
// Make sure root logger is initialized ahead of FS mock
createRootLogger();
describe('appPlugin', () => {
afterEach(() => {
mockDir.clear();
+4 -3
View File
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import { notFoundHandler } from '@backstage/backend-common';
import {
DatabaseService,
resolvePackagePath,
@@ -22,7 +21,7 @@ import {
} from '@backstage/backend-plugin-api';
import { AppConfig } from '@backstage/config';
import helmet from 'helmet';
import express from 'express';
import express, { Request, Response } from 'express';
import Router from 'express-promise-router';
import fs from 'fs-extra';
import { resolve as resolvePath } from 'path';
@@ -299,7 +298,9 @@ async function createEntryPointRouter({
if (staticFallbackHandler) {
staticRouter.use(staticFallbackHandler);
}
staticRouter.use(notFoundHandler());
staticRouter.use((_req: Request, res: Response) => {
res.status(404).end();
});
router.use('/static', staticRouter);