Skip to content

Commit

Permalink
Bug #858623 - Enable jsonp for public API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuck committed Apr 5, 2013
1 parent ffea28e commit e70355e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ module.exports = function routesCtor( app, Project, filter, sanitizer,
function( req, res ) {
Project.findRecentlyCreated( { limit: req.params.limit }, function( err, projects ) {
if ( err ) {
res.json( { error: err }, 500 );
res.jsonp( { error: err }, 500 );
}
res.json( { error: 'okay', results: pruneSearchResults( projects ) } );
res.jsonp( { error: 'okay', results: pruneSearchResults( projects ) } );
});
});

Expand All @@ -66,9 +66,9 @@ module.exports = function routesCtor( app, Project, filter, sanitizer,
function( req, res ) {
Project.findRecentlyUpdated( { limit: req.params.limit }, function( err, projects ) {
if ( err ) {
res.json( { error: err }, 500 );
res.jsonp( { error: err }, 500 );
}
res.json( { error: 'okay', results: pruneSearchResults( projects ) } );
res.jsonp( { error: 'okay', results: pruneSearchResults( projects ) } );
});
});

Expand All @@ -78,9 +78,9 @@ module.exports = function routesCtor( app, Project, filter, sanitizer,
function( req, res ) {
Project.findRemixes( { id: req.params.id }, function( err, projects ) {
if ( err ) {
res.json( { error: err }, 500 );
res.jsonp( { error: err }, 500 );
}
res.json( { error: 'okay', results: pruneSearchResults( projects ) } );
res.jsonp( { error: 'okay', results: pruneSearchResults( projects ) } );
});
});

Expand Down

0 comments on commit e70355e

Please sign in to comment.