fix: Vercel deployment - skip app.listen() on Vercel, fix vercel.json routes

This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-25 02:37:27 +05:30
parent 4ec1ff69f4
commit 399f9b1917
2 changed files with 18 additions and 9 deletions
+4 -2
View File
@@ -259,12 +259,14 @@ app.use((req, res) => {
});
// ══════════════════════════════════════════════════════════════
// SERVER START
// SERVER START (only when running standalone, not on Vercel)
// ══════════════════════════════════════════════════════════════
if (!process.env.VERCEL) {
app.listen(PORT, () => {
console.log(`[${new Date().toISOString()}] MiruroAPI v2.0.0 listening at ${PORT}`);
console.log(`[${new Date().toISOString()}] MiruroAPI v2.1.0 listening at ${PORT}`);
});
}
module.exports = app;
+11 -4
View File
@@ -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"
}
]
}