vets-who-code-app
vets-who-code-app copied to clipboard
Add veteran status verification
Add API route and frontend form for Veteran Confirmation API integration.
-
API Route: Create
veteran-status.ts
inpages/api
directory to handle POST requests, extractfirstName
,lastName
,birthDate
, andssn
from the request body, send a POST request to the Veteran Confirmation API, include the API key from environment variables in the request headers, and return the API response as JSON or an error message. -
Frontend Form: Create
VeteranStatus.tsx
inpages
directory to display a form with fields forfirstName
,lastName
,birthDate
, andssn
, send the form data to theveteran-status
API route via a POST request when submitted, and display the API response or an error message to the user. -
Environment Variable: Add
.env.local
file to store theVA_API_KEY
environment variable securely.
For more details, open the Copilot Workspace session.