Skip to content

Commit

Permalink
standard --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
runely committed Apr 28, 2021
1 parent bf2bb9b commit bb653ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const validateJwt = require('./lib/validate-jwt')

module.exports = async (req, response) => {
const { query } = await parse(req.url, true)
let data = ['POST', 'PUT'].includes(req.method) ? await json(req) : query
const data = ['POST', 'PUT'].includes(req.method) ? await json(req) : query

if (['POST'].includes(req.method)) {
const jwt = req.headers.authorization
Expand Down
14 changes: 8 additions & 6 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ const winston = require('winston')
require('winston-papertrail').Papertrail // eslint-disable-line no-unused-expressions

function getPapertrail () {
return process.env.NODE_ENV !== 'production' ? {} : new winston.transports.Papertrail({
host: config.PAPERTRAIL_HOST,
port: config.PAPERTRAIL_PORT,
hostname: config.PAPERTRAIL_HOSTNAME,
logFormat: (level, message) => `${level.toUpperCase()} - ${message || ''}`
})
return process.env.NODE_ENV !== 'production'
? {}
: new winston.transports.Papertrail({
host: config.PAPERTRAIL_HOST,
port: config.PAPERTRAIL_PORT,
hostname: config.PAPERTRAIL_HOSTNAME,
logFormat: (level, message) => `${level.toUpperCase()} - ${message || ''}`
})
}

const winstonPapertrail = getPapertrail()
Expand Down

0 comments on commit bb653ae

Please sign in to comment.