Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: rtc on File Upload #504

Merged
merged 19 commits into from
Sep 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
enhancement: handle not found error on backend
  • Loading branch information
oscar-ekeyekwu committed Sep 26, 2021
commit ec8a3c3fa15bc37f82bc371594ff96e09c8415cd
6 changes: 6 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const pluginRouter = require('./backend/routes/plugin.router');
const rootRouter = require('./backend/routes/index')(router);
const isProduction = process.env.NODE_ENV === 'production';
const ErrorHandler = require('./backend/middlewares/errorHandler');
const { NotFoundError } = require('./backend/utils/appError');



app.use(compression()); // Node.js compression middleware
Expand Down Expand Up @@ -46,6 +48,10 @@ if (isProduction) {
app.use('/', pluginRouter); // For... nvm
app.use('/api/v1', rootRouter); // For mounting the root router on the specified path

// Handle resource not found error on backend
app.use('/api/*', (req,res,next)=>{
next(new NotFoundError);
})
// All other GET requests not handled before will return our React app
app.get('*', (req, res) => {
isProduction
Expand Down