dynamic worker routes based on env

This commit is contained in:
Ishaan Dey
2024-05-26 18:37:36 -07:00
parent 6285a68102
commit 6376493ae7
17 changed files with 427 additions and 260 deletions

View File

@ -18,7 +18,12 @@ export async function POST(request: NextRequest) {
}
const res = await fetch(
`https://database.ishaan1013.workers.dev/api/user?id=${clerkUser.id}`
`${process.env.NEXT_PUBLIC_DATABASE_WORKER_URL}/api/user?id=${clerkUser.id}`,
{
headers: {
Authorization: `${process.env.NEXT_PUBLIC_WORKERS_KEY}`,
},
}
)
const user = (await res.json()) as User