Skip to content

Commit

Permalink
Removed view engine code
Browse files Browse the repository at this point in the history
  • Loading branch information
Froilan Irizarry committed Apr 14, 2019
1 parent 725ca4a commit 7ef60aa
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ app.use(cookieParser());
app.use('/', indexRouter);
app.use('/users', usersRouter);

if (process.env.NODE_ENV === 'production') {
// Express will serve up the production asset
// like main.js or main.css!
app.use(express.static(path.join(__dirname, 'client/build')));
// express will serve up the index.html file
// if it doesn't reconize the route
// app.get('/', (req, res) => {
// res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));
// });
}

// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
Expand All @@ -67,9 +56,7 @@ app.use(function(err, req, res, next) {
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};

// render the error page
res.status(err.status || 500);
res.render('error');
res.sendStatus(err.status || 500);
});

module.exports = app;

0 comments on commit 7ef60aa

Please sign in to comment.