Skip to content

Instantly share code, notes, and snippets.

@lholmquist
Created October 10, 2012 17:01
Show Gist options
  • Save lholmquist/3866918 to your computer and use it in GitHub Desktop.
Save lholmquist/3866918 to your computer and use it in GitHub Desktop.
Pipeline jsonp
//https://github.com/lholmquist/WoWAerogear if you have yeoman installed, you should be able to do yeoman server, might have to do yeoman build first though
//excerpt from app.js
pipeline.add( {
name: "wowPipe",
settings: {
baseURL: "http://us.battle.net/api/wow/",
endpoint: "achievement/2144", //this should be in the read method, need datamanager for that?
jsonp: true,
callback: "myCallback" //possibly a jsonp settings:{ } instead?
}
} );
//in AeroGear.Pipeline.adapters.Rest
//Updated the ajaxSettings
........
ajaxSettings = {
// use the pipeName as the default rest endpoint
url: settings.baseURL ? settings.baseURL + endpoint : endpoint,
jsonp :settings.jsonp ? "jsonp" : null,
dataType: settings.jsonp ? "jsonp" : "json",
jsonpCallback: ( settings.jsonp && settings.callback ) ? settings.callback : null
},
........
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment