require('dotenv').config(); const { createApp } = require('./app'); const app = createApp(); // garante fallback caso Plesk não exponha PORT const port = process.env.PORT || 3000; app.listen(port, () => { console.log(`Server running on http://localhost:${port} (NODE_ENV=${process.env.NODE_ENV || 'development'})`); }); process.on('uncaughtException', err => { console.error('uncaughtException', err); }); process.on('unhandledRejection', err => { console.error('unhandledRejection', err); });