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

Add logging for app #9

Merged
merged 4 commits into from
Nov 16, 2020
Merged

Add logging for app #9

merged 4 commits into from
Nov 16, 2020

Conversation

Jorbreezy
Copy link
Owner

No description provided.

const path = require('path');
const fs = require('fs');

const logDir = 'logs';

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) {

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?

Copy link
Owner Author

@Jorbreezy Jorbreezy Nov 16, 2020

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.

@Jorbreezy Jorbreezy merged commit 8e54c9e into main Nov 16, 2020
@Jorbreezy Jorbreezy deleted the add-logging-for-app branch November 16, 2020 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants