feat: add server config endpoint

This commit is contained in:
shinya
2025-07-09 22:02:51 +08:00
parent 664ebf3c1f
commit db13b26a8b
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { NextRequest, NextResponse } from 'next/server';
import { getConfig } from '@/lib/config';
export const runtime = 'edge';
export async function GET(_: NextRequest) {
const config = getConfig();
const result = {
SiteName: config.SiteConfig.SiteName,
StorageType: process.env.NEXT_PUBLIC_STORAGE_TYPE || 'localstorage',
};
return NextResponse.json(result);
}

View File

@@ -132,6 +132,7 @@ function shouldSkipAuth(pathname: string): boolean {
'/api/login',
'/api/register',
'/api/logout',
'/api/server-config',
'/_next',
'/favicon.ico',
'/robots.txt',