Skip to content

Commit

Permalink
fix: remove/update log statement
Browse files Browse the repository at this point in the history
fix: address deprecation warnings for session middleware
  • Loading branch information
evanshortiss committed Apr 20, 2020
1 parent f880292 commit cf2b5ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(session({
secret: config.sessionSecret,
resave: false,
saveUninitialized: true,
cookie: {
// Length of workshop in milliseconds
maxAge: timestring(config.eventHours, 'ms')
Expand Down
11 changes: 6 additions & 5 deletions bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var app = require('../app');
var debug = require('debug')('user-distribution:server');
var http = require('http');
var log = require('barelog')

/**
* Get port from environment and store in Express.
Expand Down Expand Up @@ -65,11 +66,11 @@ function onError(error) {
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
log(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
log(bind + ' is already in use');
process.exit(1);
break;
default:
Expand All @@ -86,8 +87,8 @@ function onListening() {
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
console.log('App started on Port',addr.port || addr);
console.log('Listening on',bind);
console.log('server',addr);
log('App started on Port',addr.port || addr);
log('Listening on',bind);
log('server',addr);
debug('Listening on ' + bind);
}
1 change: 0 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const env = require('env-var')
const { randomBytes } = require('crypto')

console.log(process.env.LAB_MODULE_URLS)
module.exports = {
sessionSecret: env.get('LAB_SESSION_SECRET').default(randomBytes(8).toString()).asString(),
eventTitle: env.get('LAB_TITLE').default('OCP4 Workshop').asString(),
Expand Down

0 comments on commit cf2b5ad

Please sign in to comment.