Cursor'da form

Ajanın API route eklememesini söyleyin. Form doğrudan Formgong'a gider.

  1. Site reposunu Cursor'da açın.
  2. Promptu yapıştırın.
  3. Bu form için sunucu secret'ı olmadığını kontrol edin.
  4. Başvurular gelince CSV dışa aktarın.

Prompt

Formgong'a gönderilen bir iletişim formu ekle. Bu repoda API route oluşturma.

POST https://formgong.com/submit
access_key: fk_your_access_key
Alanlar: name, email, message ve gizli botcheck.
fetch için Accept: application/json kullan ve success alanını kontrol et.

fetch

async function onSubmit(event) {
  event.preventDefault();
  const fields = Object.fromEntries(new FormData(event.currentTarget));
  const response = await fetch("https://formgong.com/submit", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Accept: "application/json",
    },
    body: JSON.stringify({ ...fields, access_key: "fk_your_access_key" }),
  });
  const result = await response.json();
  if (!result.success) throw new Error(result.message || "Formgong error");
}

Anahtar al