Heroku not finding endpoint with Express

So I created this local host app I am trying to deploy to Heroku with express and for some reason it works on localhost but not on the Heroku API, getting 502, if someone could help that would be awesome!

app.listen(process.env.PORT || 3000, () => console.log('listening at 3000'));
app.use(express.static('public'));
app.use(express.json({ limit: '5mb' }));
const database = new Datastore('database.db');
database.loadDatabase();
app.get('/api', (request, response) => {
database.find({}, (err, data) => {
if (err) {
  response.end();
  return;
}
response.json(data);
});
});

Wondering why this occurring to be honest, deployed many apps with the same setup and never had it happen like this. The package.json has all the proper NPM packages aswell