19 lines
394 B
JavaScript
19 lines
394 B
JavaScript
// Express middelware for adding X-Http-Cat header using http.cat api from
|
|
// https://http.cat/
|
|
|
|
function middelware (req, res, next) {
|
|
var _writeHead = res.writeHead
|
|
res.writeHead = function(status) {
|
|
res.setHeader('X-Http-Cat', 'https://http.cat/' + status)
|
|
_writeHead.apply(res, arguments)
|
|
}
|
|
|
|
next()
|
|
}
|
|
|
|
|
|
module.exports = function(){
|
|
return middelware;
|
|
}
|
|
|