This commit is contained in:
payacom
2026-07-11 20:52:56 +03:30
parent 3c90976f23
commit 54971578b0
6 changed files with 103 additions and 10 deletions

View File

@@ -1,9 +1,13 @@
require('dotenv').config()
console.log('APP_PORT:', process.env.APP_PORT)
const bootApplication = require('./index')
// index.js خودش روی پورت listen می‌کند (اجرای مستقیم روی سرور: node index.js).
// اینجا فقط require می‌کنیم تا سرور بالا بیاید. اگر نسخه‌ای از index.js تابع
// export کند، آن را هم صدا می‌زنیم تا با هر دو حالت سازگار باشد.
const app = require('./index')
console.log('Index loaded, booting...')
const port = process.env.APP_PORT || 3002
bootApplication(port)
console.log(`✅ Server should be running on port ${port}`)
if (typeof app === 'function') {
const port = process.env.APP_PORT || 3002
app(port)
}