Skip to content

Commit

Permalink
adds catch-all server error response
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallford committed Jun 13, 2016
1 parent 8148689 commit 8610bde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server.js
Expand Up @@ -9,6 +9,10 @@ const app = express()
app.server = http.createServer(app)
app.use(bodyParser.json())
app.use('/api/v1', api())
app.use((err, req, res, next) => {
console.error(err.stack)
res.status(500).json({ message: 'catch-all server error, check the logs' })
})

const requiredProviderInfo = ['key', 'url', 'path', 'limit']

Expand Down

0 comments on commit 8610bde

Please sign in to comment.