Skip to content

Commit

Permalink
feat(website): sneaky sneaky 2
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Mar 24, 2023
1 parent 71eba0e commit 3bd7607
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ out/
# Cache
.prettiercache
.eslintcache
.vercel
1 change: 1 addition & 0 deletions apps/website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pids

# Env
.env
.env*.local

# Dist
dist/
Expand Down
1 change: 1 addition & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 28 additions & 0 deletions apps/website/src/app/api/cron/route.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions apps/website/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"crons": [
{
"path": "/api/cron",
"schedule": "0 0 * * 3"
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"turbo": "^1.8.5",
"typescript": "^5.0.2",
"unocss": "^0.50.6",
"vercel": "^28.18.1",
"vitest": "^0.29.7"
},
"resolutions": {
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://turborepo.org/schema.json",
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["yarn.lock"],
"pipeline": {
"build": {
Expand Down
9 changes: 9 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,7 @@ __metadata:
turbo: ^1.8.5
typescript: ^5.0.2
unocss: ^0.50.6
vercel: ^28.18.1
vitest: ^0.29.7
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -2408,6 +2409,7 @@ __metadata:
"@unocss/cli": ^0.50.6
"@unocss/reset": ^0.50.6
"@vercel/analytics": ^0.1.11
"@vercel/edge-config": ^0.1.5
"@vercel/og": ^0.4.1
"@vitejs/plugin-react": ^3.1.0
"@vitest/coverage-c8": ^0.29.7
Expand Down Expand Up @@ -5861,6 +5863,13 @@ __metadata:
languageName: node
linkType: hard

"@vercel/edge-config@npm:^0.1.5":
version: 0.1.5
resolution: "@vercel/edge-config@npm:0.1.5"
checksum: dec5f0794a6e9210f6f22b1d98f94c696f68bdcc6eed8bcd22e19572195285463663c65e2e3642bfbe2232bf0c460490b6cf3780dee638bec2b84157f4506d9b
languageName: node
linkType: hard

"@vercel/gatsby-plugin-vercel-analytics@npm:1.0.8":
version: 1.0.8
resolution: "@vercel/gatsby-plugin-vercel-analytics@npm:1.0.8"
Expand Down

2 comments on commit 3bd7607

@vercel
Copy link

@vercel vercel bot commented on 3bd7607 Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 3bd7607 Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.