Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/web/src/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ describe("Web Application", () => {

it("should register public pages routes", async () => {
const { createSimpleRouter } = await import("@hmcts/simple-router");
// Should be called 8 times: location API routes, civil-family-cause-list pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
expect(createSimpleRouter).toHaveBeenCalledTimes(8);
// Should be called 9 times: location API routes, civil-family-cause-list pages, care-standards-tribunal pages, web pages, auth routes, public pages, verified pages, system-admin pages, admin routes
expect(createSimpleRouter).toHaveBeenCalledTimes(9);
});

it("should register system-admin page routes", async () => {
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import "@hmcts/web-core"; // Import for Express type augmentation
import { fileUploadRoutes as adminFileUploadRoutes, moduleRoot as adminModuleRoot, pageRoutes as adminRoutes } from "@hmcts/admin-pages/config";
import { authNavigationMiddleware, cftCallbackHandler, configurePassport, ssoCallbackHandler } from "@hmcts/auth";
import { moduleRoot as authModuleRoot, pageRoutes as authRoutes } from "@hmcts/auth/config";
import {
moduleRoot as careStandardsTribunalModuleRoot,
pageRoutes as careStandardsTribunalRoutes
} from "@hmcts/care-standards-tribunal-weekly-hearing-list/config";
import { moduleRoot as civilFamilyCauseListModuleRoot, pageRoutes as civilFamilyCauseListRoutes } from "@hmcts/civil-and-family-daily-cause-list/config";
import { configurePropertiesVolume, healthcheck, monitoringMiddleware } from "@hmcts/cloud-native-platform";
import { moduleRoot as listTypesCommonModuleRoot } from "@hmcts/list-types-common/config";
Expand Down Expand Up @@ -69,6 +73,7 @@ export async function createApp(): Promise<Express> {
adminModuleRoot,
authModuleRoot,
listTypesCommonModuleRoot,
careStandardsTribunalModuleRoot,
civilFamilyCauseListModuleRoot,
systemAdminModuleRoot,
publicPagesModuleRoot,
Expand Down Expand Up @@ -106,8 +111,9 @@ export async function createApp(): Promise<Express> {
// Register API routes for location autocomplete
app.use(await createSimpleRouter(locationApiRoutes));

// Register civil-and-family-daily-cause-list routes first to ensure proper route matching
// Register list type routes first to ensure proper route matching
app.use(await createSimpleRouter(civilFamilyCauseListRoutes));
app.use(await createSimpleRouter(careStandardsTribunalRoutes));

app.use(await createSimpleRouter({ path: `${__dirname}/pages` }, pageRoutes));
app.use(await createSimpleRouter(authRoutes, pageRoutes));
Expand Down
Loading