Application error using heroku will not deploy any of my backend code

I am tyring to deploy the following files after pushig and installing all necessary files but i keep getting the same application error page on Heroku. This is the file one of the files I am pushing

import express from 'express';
import bodyParser from 'body-parser';
import mysql from 'mysql';
import cors from 'cors';
import account from './account.js'
const app = express();

const db = mysql.createConnection({
    host: 'database-3.c12ew6m4ku0j.us-east-2.rds.amazonaws.com',
    user: 'root',
    password: 'password',
    database: 'calendrive'
});

const PORT = 3001;
db.connect(err => {
    if (err) throw err;
    console.log('Connected to the database');
});
app.use(cors());

// Setup CORS settings
app.use(cors({
    // Required for sessions to work
    // Will likely need changed on a production server
    origin: ["http://localhost:8080", "http://localhost:8800"],
    credentials: true
}));
app.use(express.json());


// Get all events
app.get('/events', (req, res) => {
    db.query('SELECT * FROM events', (err, data) => {
        if (err) return res.json(err);
        return res.json(data);
    });
});

// Add new event
app.post('/events', (req, res) => {
    const values = [req.body.name, req.body.desc, req.body.address, req.body.start, req.body.end];
    const q = "INSERT INTO events (`name`, `desc`, `address`, `start`, `end`) VALUES (?)";
    db.query(q, [values], (err, data) => {
        if (err) return res.json(err);
        return res.json(data);
    });
});

// Update event
app.put('/events/:id', (req, res) => {
    const eventId = req.params.id;
    const values = [req.body.name, req.body.desc, req.body.address, req.body.start, req.body.end];
    const q = "UPDATE events SET `name` =?, `desc` =?, `address` =?, `start` =?, `end` =? WHERE id=?"
    db.query(q, [...values, eventId], (err, result) => {
        if (err) return res.json(err);
        return res.json('Event updated');
    });
});

// Delete event
app.delete('/events/:id', (req, res) => {
    const eventId = req.params.id;
    db.query('DELETE FROM events WHERE id=?', [eventId], (err, result) => {
        if (err) throw err;
        res.json('Event deleted');
    });
});

account.setup(app);

// Start the backend HTTP server on port 8800
app.listen((process.env.PORT || PORT), () => {
    console.log(`server running on PORT ${PORT}`);
});

I’ve tried changing things around, commenting out some blocks, but I keep getting the same page. I also tried restarting the dynos and still got nothing.