configure board source in typescript

This commit is contained in:
dexx
2026-06-05 03:02:41 +03:00
parent 1bafc85226
commit 92cf1eaa63
4 changed files with 23 additions and 143 deletions
+5 -6
View File
@@ -1,4 +1,5 @@
import { NextResponse } from "next/server";
import { boardConfig } from "../../../board.config";
type GithubContent = {
name: string;
@@ -68,12 +69,10 @@ async function fetchDirectory(owner: string, repo: string, path: string, branch?
};
}
export async function GET(request: Request) {
const { searchParams } = new URL(request.url);
const repoValue = searchParams.get("repo") || process.env.NEXT_PUBLIC_GITHUB_REPO || null;
const branch = searchParams.get("branch") || process.env.NEXT_PUBLIC_GITHUB_BRANCH || undefined;
const path = searchParams.get("path") || process.env.NEXT_PUBLIC_GITHUB_PHOTOS_PATH || "";
const parsedRepo = parseRepo(repoValue);
export async function GET() {
const branch = boardConfig.branch || undefined;
const path = boardConfig.photosPath;
const parsedRepo = parseRepo(boardConfig.repo);
if (!parsedRepo) {
return NextResponse.json({