mirror of
https://github.com/Shineii86/MiruroAPI.git
synced 2026-10-22 10:15:10 +00:00
fix: Vercel deployment - skip app.listen() on Vercel, fix vercel.json routes
This commit is contained in:
@@ -259,12 +259,14 @@ app.use((req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
// SERVER START
|
// SERVER START (only when running standalone, not on Vercel)
|
||||||
// ══════════════════════════════════════════════════════════════
|
// ══════════════════════════════════════════════════════════════
|
||||||
|
|
||||||
app.listen(PORT, () => {
|
if (!process.env.VERCEL) {
|
||||||
console.log(`[${new Date().toISOString()}] MiruroAPI v2.0.0 listening at ${PORT}`);
|
app.listen(PORT, () => {
|
||||||
});
|
console.log(`[${new Date().toISOString()}] MiruroAPI v2.1.0 listening at ${PORT}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = app;
|
module.exports = app;
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -1,8 +1,15 @@
|
|||||||
{
|
{
|
||||||
"functions": {
|
"version": 2,
|
||||||
"api/index.js": {
|
"builds": [
|
||||||
"includeFiles": "src/**",
|
{
|
||||||
"maxDuration": 30
|
"src": "api/index.js",
|
||||||
|
"use": "@vercel/node"
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"src": "/api/(.*)",
|
||||||
|
"dest": "/api/index.js"
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user