Skip to content

Commit f32625b

Browse files
committed
feat(contact): switch worker to workers.dev with cors, drop zone routes
1 parent e24d12e commit f32625b

6 files changed

Lines changed: 952 additions & 22 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- run: pnpm build
3535
env:
3636
NEXT_TELEMETRY_DISABLED: "1"
37+
NEXT_PUBLIC_CONTACT_API_URL: ${{ vars.NEXT_PUBLIC_CONTACT_API_URL }}
3738

3839
- uses: actions/configure-pages@v5
3940

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# dependencies
44
/node_modules
5+
worker/node_modules
6+
worker/.wrangler
57
/.pnp
68
.pnp.*
79
.yarn/*

components/site/contact-form.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export function ContactForm() {
7171
setStatus("submitting");
7272

7373
try {
74-
const res = await fetch("/api/contact", {
74+
const endpoint =
75+
process.env.NEXT_PUBLIC_CONTACT_API_URL || "/api/contact";
76+
const res = await fetch(endpoint, {
7577
method: "POST",
7678
headers: { "Content-Type": "application/json" },
7779
body: JSON.stringify(parsed.data),

0 commit comments

Comments
 (0)