diff --git a/server.js b/server.js index 1e6e9f8..49052d4 100644 --- a/server.js +++ b/server.js @@ -259,12 +259,14 @@ app.use((req, res) => { }); // ══════════════════════════════════════════════════════════════ -// SERVER START +// SERVER START (only when running standalone, not on Vercel) // ══════════════════════════════════════════════════════════════ -app.listen(PORT, () => { - console.log(`[${new Date().toISOString()}] MiruroAPI v2.0.0 listening at ${PORT}`); -}); +if (!process.env.VERCEL) { + app.listen(PORT, () => { + console.log(`[${new Date().toISOString()}] MiruroAPI v2.1.0 listening at ${PORT}`); + }); +} module.exports = app; diff --git a/vercel.json b/vercel.json index 30202ac..4cd23e9 100644 --- a/vercel.json +++ b/vercel.json @@ -1,8 +1,15 @@ { - "functions": { - "api/index.js": { - "includeFiles": "src/**", - "maxDuration": 30 + "version": 2, + "builds": [ + { + "src": "api/index.js", + "use": "@vercel/node" } - } + ], + "routes": [ + { + "src": "/api/(.*)", + "dest": "/api/index.js" + } + ] }