Creating a proxy to generate AngularJS $resources