Merged in chore/LOY-445-remove-dtmc-flag (pull request #3043)

chore(LOY-445): remove ENABLE_DTMC flag & add documentation

* chore(LOY-445): remove ENABLE_DTMC flag & add documentation


Approved-by: Matilda Landström
This commit is contained in:
Chuma Mcphoy (We Ahead)
2025-10-31 08:39:13 +00:00
parent 742fcbe588
commit 7abe190bed
6 changed files with 267 additions and 24 deletions

View File

@@ -1,17 +1,10 @@
import { type NextMiddleware, NextResponse } from "next/server"
import { handleDTMC } from "@/constants/routes/dtmc"
import { env } from "@/env/server"
import { notFound } from "@/server/errors/next"
import type { MiddlewareMatcher } from "@/types/middleware"
export const middleware: NextMiddleware = (request) => {
if (!env.ENABLE_DTMC) {
throw notFound(
`ENABLE_DTMC is disabled, returning notFound for DTMC Route: ${request.nextUrl.pathname}`
)
}
export const middleware: NextMiddleware = () => {
return NextResponse.next()
}