Add Support & Social module to dashboard sidebar
This commit is contained in:
15
src/app/api/twitch/status/route.ts
Normal file
15
src/app/api/twitch/status/route.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getTwitchStatus } from '@/lib/twitch';
|
||||
|
||||
export async function GET(request: Request) {
|
||||
const { searchParams } = new URL(request.url);
|
||||
const username = searchParams.get('username');
|
||||
|
||||
if (!username) {
|
||||
return NextResponse.json({ error: 'Username is required' }, { status: 400 });
|
||||
}
|
||||
|
||||
const isLive = await getTwitchStatus(username);
|
||||
|
||||
return NextResponse.json({ isLive });
|
||||
}
|
||||
Reference in New Issue
Block a user