Spaces:
Build error
Build error
| export default function handler(req, res) { | |
| if (req.method !== 'POST') { | |
| return res.status(405).json({ message: 'Method not allowed' }); | |
| } | |
| try { | |
| const { name, email, message } = req.body; | |
| // Here you would typically send the email or save to database | |
| // For this example, we'll just return a success response | |
| console.log('Contact form submission:', { name, email, message }); | |
| return res.status(200).json({ success: true }); | |
| } catch (error) { | |
| console.error('Contact form error:', error); | |
| return res.status(500).json({ message: 'Internal server error' }); | |
| } | |
| } |