Fix Vercel deploy: build dist and run Express as serverless.

This commit is contained in:
b1rdmania
2025-12-18 19:16:47 +00:00
parent 1b10f006f9
commit 96477e9c4a
3 changed files with 30 additions and 8 deletions
+9 -3
View File
@@ -83,6 +83,12 @@ app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
app.listen(port, () => {
console.log(`🎵 Motif backend running on port ${port}`);
});
// Vercel serverless runtime expects an exported handler (Express apps are handlers).
// Locally, we still want to run a dev server with `app.listen`.
export default app;
if (!process.env.VERCEL) {
app.listen(port, () => {
console.log(`🎵 Motif backend running on port ${port}`);
});
}