added exam routes

This commit is contained in:
shafin-r
2025-07-05 19:05:47 +06:00
parent 576398883d
commit 06418a82ab
8 changed files with 926 additions and 20 deletions

View File

@ -5,15 +5,17 @@ import { ChevronLeft, Layers } from "lucide-react";
import { useTimer } from "@/context/TimerContext";
import styles from "@/css/Header.module.css";
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3000/api";
const API_URL = "https://examjam-api.pptx704.com";
// You'll need to implement getToken for Next.js - could use cookies, localStorage, etc.
const getToken = async () => {
// Replace with your token retrieval logic
if (typeof window !== "undefined") {
return localStorage.getItem("token") || sessionStorage.getItem("token");
if (typeof window === "undefined") {
return null;
}
return null;
// Extract authToken from cookies
const match = document.cookie.match(/(?:^|;\s*)authToken=([^;]*)/);
return match ? decodeURIComponent(match[1]) : null;
};
const Header = ({