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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user