-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add logging for app #9
Conversation
config/winston.js
Outdated
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const logDir = 'logs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use __dirname
and path
package to create absolute paths.
app.js
Outdated
@@ -26,7 +27,7 @@ app.use(express.static(path.join(__dirname, 'public'))); | |||
app.use('/', indexRouter, gamesRouter, studioRouter); | |||
|
|||
// catch 404 and forward to error handler | |||
app.use(function(req, res, next) { | |||
app.use('*', function(req, res, next) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, the location of this middleware will catch any unhandled requests. What does adding in a * glob do for us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, I'll remove it.
No description provided.