Spaces:
Build error
Build error
Upload pages/api/contact.js with huggingface_hub
Browse files- pages/api/contact.js +15 -0
pages/api/contact.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export default function handler(req, res) {
|
| 2 |
+
if (req.method === 'POST') {
|
| 3 |
+
const { name, email, message } = req.body;
|
| 4 |
+
|
| 5 |
+
// In a real application, you would process the contact form data here
|
| 6 |
+
// For example, send an email or save to a database
|
| 7 |
+
|
| 8 |
+
console.log('Contact form submission:', { name, email, message });
|
| 9 |
+
|
| 10 |
+
res.status(200).json({ success: true, message: 'Thank you for your message!' });
|
| 11 |
+
} else {
|
| 12 |
+
res.setHeader('Allow', ['POST']);
|
| 13 |
+
res.status(405).end(`Method ${req.method} Not Allowed`);
|
| 14 |
+
}
|
| 15 |
+
}
|