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

@@ -13,6 +13,7 @@ pids
# Env
.env
.env*.local
# Dist
dist/

View File

@@ -52,6 +52,7 @@
"@microsoft/tsdoc": "0.14.2",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^0.1.11",
"@vercel/edge-config": "^0.1.5",
"@vercel/og": "^0.4.1",
"@vscode/codicons": "^0.0.32",
"ariakit": "^2.0.0-next.43",

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' });
}

8
apps/website/vercel.json Normal file
View File

@@ -0,0 +1,8 @@
{
"crons": [
{
"path": "/api/cron",
"schedule": "0 0 * * 3"
}
]
}