feat(website): sneaky sneaky 2

This commit is contained in:
iCrawl
2023-03-24 01:54:21 +01:00
parent 71eba0e1b2
commit 3bd76078e1
8 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
import { get } from '@vercel/edge-config';
import { NextResponse } from 'next/server';
import type { ServerRuntime } from 'next/types';
export const runtime: ServerRuntime = 'edge';
export async function GET() {
const url = await get<string>('DISCORD_WEBHOOK_URL');
const imageUrl = await get<string>('IT_IS_WEDNESDAY_MY_DUDES');
if (url && imageUrl) {
await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
username: 'It is wednesday, my dudes',
embeds: [
{
image: {
url: imageUrl,
},
},
],
}),
});
}
return NextResponse.json({ message: 'It is wednesday, my dudes' });
}