simplifying the deployment
This commit is contained in:
15
index.js
15
index.js
@@ -1,12 +1,8 @@
|
||||
const winston = require('winston');
|
||||
const express = require('express');
|
||||
const { createClient } = require('@supabase/supabase-js');
|
||||
const Bot = require('./src/Bot');
|
||||
require('dotenv').config();
|
||||
|
||||
// Initialize Express app
|
||||
const app = express();
|
||||
|
||||
// Initialize logger
|
||||
const logger = winston.createLogger({
|
||||
level: 'debug',
|
||||
@@ -30,17 +26,6 @@ const supabase = createClient(
|
||||
process.env.SUPABASE_KEY
|
||||
);
|
||||
|
||||
// Add health check endpoint
|
||||
app.get('/health', (req, res) => {
|
||||
res.status(200).json({ status: 'healthy' });
|
||||
});
|
||||
|
||||
// Start Express server
|
||||
const port = process.env.NOTIFICATION_PORT || 3000;
|
||||
app.listen(port, () => {
|
||||
logger.info(`Health check server listening on port ${port}`);
|
||||
});
|
||||
|
||||
// Initialize and start bot
|
||||
const bot = new Bot(process.env.DISCORD_TOKEN, supabase, logger);
|
||||
bot.start().catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user