anycoder-5df874db / pages /api /contact.js
Svenson1974's picture
Upload pages/api/contact.js with huggingface_hub
082a697 verified
Raw
History Blame
527 Bytes
export default function handler(req, res) {
if (req.method === 'POST') {
const { name, email, message } = req.body;
// In a real application, you would process the contact form data here
// For example, send an email or save to a database
console.log('Contact form submission:', { name, email, message });
res.status(200).json({ success: true, message: 'Thank you for your message!' });
} else {
res.setHeader('Allow', ['POST']);
res.status(405).end(`Method ${req.method} Not Allowed`);
}
}