Added various UI components and navigation elements including: - Section cards and selection components - Social icon SVGs with horizontal/vertical text variants - Table, tabs, and toggle components - Site header and sidebar components - Tooltip and unauthorized page - Project configuration files (tsconfig.json) - Route handlers for health checks - Utility and hook functions for mobile responsiveness
28 lines
947 B
TypeScript
28 lines
947 B
TypeScript
import { NextRequest, NextResponse } from "next/server"
|
|
|
|
export function middleware(request: NextRequest) {
|
|
// Check if environment is production and if the app is ready
|
|
const isProd = process.env.NODE_ENV === "production"
|
|
const isReady = process.env.READY === "true"
|
|
|
|
// If in production and not ready, redirect to under-development
|
|
if (isProd && !isReady) {
|
|
return NextResponse.redirect(new URL("/under-development", request.url))
|
|
}
|
|
|
|
// Original redirect for /about paths
|
|
if (request.nextUrl.pathname.startsWith("/about")) {
|
|
return NextResponse.redirect(new URL("/home", request.url))
|
|
}
|
|
|
|
if (process.env.NODE_ENV === "development") {
|
|
// return NextResponse.redirect(new URL("/showcase", request.url))
|
|
}
|
|
|
|
return NextResponse.next()
|
|
}
|
|
|
|
export const config = {
|
|
// Match about paths and the root path to check readiness
|
|
matcher: ["/about/:path*", "/((?!under-development|api|_next/static|favicon.ico).*)"],
|
|
}
|