Something went wrong. Try again.
A project designed to automate the process of fetching result screenshots from the MGU result portal, sending them to students via email as…
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
require('dotenv').config();
const db = require('./config/db');db.connect();
const { connectRabbitMQ } = require('./config/queue');connectRabbitMQ();
const chalk = require('chalk');
const express = require('express');const app = express();app.disable('x-powered-by');
var cors = require('cors')app.use(cors())
const routes = require('./routes');
app.use(express.json());app.use(express.urlencoded({ extended: true }));
app.use('/', routes);
app.use((req, res, next) => { res.status(404).json({ status: 404, message: 'Resource not found' })});
app.use((err, req, res, next) => { console.error(err.stack); res.status(500).json({ status: 500, message: 'Internal server error' })});
app.listen((process.env.PORT), () => { console.log(chalk.cyanBright(`\n--- Server started on port ${process.env.PORT}`));});