mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-05-23 07:07:33 +08:00
feat: add server config endpoint
This commit is contained in:
14
src/app/api/server-config/route.ts
Normal file
14
src/app/api/server-config/route.ts
Normal 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);
|
||||||
|
}
|
||||||
@@ -132,6 +132,7 @@ function shouldSkipAuth(pathname: string): boolean {
|
|||||||
'/api/login',
|
'/api/login',
|
||||||
'/api/register',
|
'/api/register',
|
||||||
'/api/logout',
|
'/api/logout',
|
||||||
|
'/api/server-config',
|
||||||
'/_next',
|
'/_next',
|
||||||
'/favicon.ico',
|
'/favicon.ico',
|
||||||
'/robots.txt',
|
'/robots.txt',
|
||||||
|
|||||||
Reference in New Issue
Block a user