Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Added middleware to set JSON header
Browse files Browse the repository at this point in the history
  • Loading branch information
Donald Robertson committed Mar 20, 2017
1 parent b03febb commit 1a53eda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion server/middleware/crutch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { dump } = require('../../../lib/contract')

const crutch = (req, res, next) => {
const cache = dump()
res.set({ 'Content-Type': 'application/json' }).status(200).send(cache)
res.status(200).send(cache)

return next()
}
Expand Down
9 changes: 9 additions & 0 deletions server/middleware/json/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'

const json = (req, res, next) => {
res.set({ 'Content-Type': 'application/json' })

return next()
}

module.exports = json

0 comments on commit 1a53eda

Please sign in to comment.