Skip to content

Commit 994c227

Browse files
committed
Using env for webhook
1 parent 7b88659 commit 994c227

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

pages/api/regenerate.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ const cors = Cors({ allowMethods: ['GET', 'HEAD'] });
55
async function regenerate(req, res) {
66
res.statusCode = 200;
77
res.setHeader('Content-Type', 'application/json');
8-
const webhookVercel = fetch(
9-
'https://api.vercel.com/v1/integrations/deploy/QmNYzrk6Y9P1qL6PWVTnp9fForR7FuZp8JTfFyZ71CnVVS/3qWMRbPwMg'
10-
).then((res) => res.json());
8+
const webhookVercel = fetch(process.env.WEBHOOK_VERCEL).then((res) =>
9+
res.json()
10+
);
1111

12-
const webhookAWSAmplify = fetch(
13-
'https://webhooks.amplify.eu-west-1.amazonaws.com/prod/webhooks?id=39136c3c-a922-4014-8f44-7ffc09af7da6&token=hCtGi1YQdYDPvBJPlSFU9O6s8XrMMo7hjuLJDdz5wn4',
14-
{ method: 'POST' }
15-
).then((res) => res.json());
12+
const webhookAWSAmplify = fetch(process.env.WEBHOOK_AWS_AMPLIFY, {
13+
method: 'POST',
14+
}).then((res) => res.json());
1615

1716
const response = await Promise.all([webhookVercel, webhookAWSAmplify]);
1817

vercel.json

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
{
22
"version": 2,
3-
"regions": ["bru1"],
3+
"regions": ["dub1"],
44
"headers": [
5-
{
6-
"source": "/_next/(.*)",
7-
"headers": [
8-
{
9-
"key": "Cache-Control",
10-
"value": "max-age=0, max-stale, s-maxage=5, stale-while-revalidate=30"
11-
}
12-
]
13-
},
145
{
156
"source": "/images/(.*)",
167
"headers": [

0 commit comments

Comments
 (0)