Initial page routing / page structure

This commit is contained in:
Valtteri Karesto
2021-11-19 15:25:39 +02:00
parent 45b4653d5f
commit 9f3978c8a7
5 changed files with 70 additions and 47 deletions

12
pages/_middleware.ts Normal file
View File

@@ -0,0 +1,12 @@
import type { NextRequest, NextFetchEvent } from 'next/server';
import { NextResponse as Response } from 'next/server';
import { getToken } from "next-auth/jwt"
export default function middleware(req: NextRequest, ev: NextFetchEvent) {
if (req.nextUrl.pathname === "/") {
console.log('kissa', ev);
return Response.redirect("/develop");
}
}