Skip to content

Commit 23ab895

Browse files
committed
Add debugging and fix Vercel dev configuration
1 parent 16b25fb commit 23ab895

File tree

6 files changed

+362
-0
lines changed

6 files changed

+362
-0
lines changed

api/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vercel

api/lib/redis.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export function getRedisClient() {
77
const url = process.env.UPSTASH_REDIS_REST_URL;
88
const token = process.env.UPSTASH_REDIS_REST_TOKEN;
99

10+
console.log('Redis URL:', url ? 'Present' : 'Missing');
11+
console.log('Redis Token:', token ? 'Present' : 'Missing');
12+
1013
if (!url || !token) {
1114
throw new Error('Missing UPSTASH_REDIS_REST_URL or UPSTASH_REDIS_REST_TOKEN environment variables');
1215
}

api/package-lock.json

Lines changed: 341 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

attestation-result.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ async function generateAttestationDisplay(attestation) {
3333
const savedEmail = localStorage.getItem('attest_ink_email');
3434
const savedApiKey = localStorage.getItem('attest_ink_api_key');
3535

36+
console.log('Attempting to create short URL...');
37+
console.log('Email:', savedEmail);
38+
console.log('API Key:', savedApiKey ? 'Present' : 'Not present');
39+
3640
const response = await fetch('/api/shorten', {
3741
method: 'POST',
3842
headers: {
@@ -45,7 +49,9 @@ async function generateAttestationDisplay(attestation) {
4549
})
4650
});
4751

52+
console.log('Response status:', response.status);
4853
const data = await response.json();
54+
console.log('Response data:', data);
4955

5056
if (response.ok) {
5157
shortUrl = data.shortUrl;
@@ -137,6 +143,8 @@ async function generateAttestationDisplay(attestation) {
137143
}
138144
} catch (error) {
139145
console.error('Failed to create short URL:', error);
146+
console.error('Error details:', error.message);
147+
console.error('Stack trace:', error.stack);
140148
// Fall back to regular URL
141149
}
142150
}

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "attest-ink",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "echo 'No build needed for static site'"
6+
}
7+
}

vercel.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"buildCommand": false,
3+
"outputDirectory": ".",
24
"functions": {
35
"api/**/*.js": {
46
"maxDuration": 10

0 commit comments

Comments
 (0)