wwebjs-api/server.js
Anton Voylenko 2399a31aac project push
2024-11-28 21:07:25 +02:00

16 lines
482 B
JavaScript

const app = require('./src/app')
const { baseWebhookURL } = require('./src/config')
require('dotenv').config()
// Start the server
const port = process.env.PORT || 3000
// Check if BASE_WEBHOOK_URL environment variable is available
if (!baseWebhookURL) {
console.error('BASE_WEBHOOK_URL environment variable is not set. Exiting...')
process.exit(1) // Terminate the application with an error code
}
app.listen(port, () => {
console.log(`Server running on port ${port}`)
})