13 lines
334 B
TypeScript
13 lines
334 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import type { NextRequest } from 'next/server';
|
|
|
|
export function middleware(request: NextRequest) {
|
|
// Only redirect the home page
|
|
if (request.nextUrl.pathname === '/') {
|
|
return NextResponse.redirect(new URL('/login', request.url));
|
|
}
|
|
}
|
|
|
|
export const config = {
|
|
matcher: '/',
|
|
}; |