Fix missing jsonp feature with grunt-contrib-connect

This commit is contained in:
Niklas von Hertzen 2014-09-20 18:25:28 +03:00
parent c9993a7237
commit 075c836d16

View File

@ -74,6 +74,12 @@ module.exports = function(grunt) {
port: 8082,
middleware: function(connect, options) {
return [
function(req, res, next) {
res.jsonp = function(content) {
res.end(req.query.callback + "(" + JSON.stringify(content) + ")");
};
next();
},
proxy()
];
}