Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.

Commit

Permalink
fix: Accessing any route other than / throws an error
Browse files Browse the repository at this point in the history
WDY-290
  • Loading branch information
jcmnunes committed Mar 20, 2020
1 parent d199f28 commit 24d835f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const mongooseOptions = {

// eslint-disable-next-line no-console
mongoose
.connect(process.env.MONGO_URI || '', mongooseOptions)
.connect(process.env.MONGO_URI!, mongooseOptions)
.then(() => console.log('DB connected'));

mongoose.connection.on('error', err => {
Expand Down Expand Up @@ -68,7 +68,7 @@ app.use('/api/report', report);
if (!dev) {
app.use(express.static('../frontend/build'));
app.get('*', (_, res) => {
res.sendFile(path.resolve(__dirname, '..', 'frontend', 'build', 'index.html'));
res.sendFile(path.resolve(__dirname, '..', '..', 'frontend', 'build', 'index.html'));
});
}

Expand Down

0 comments on commit 24d835f

Please # to comment.