An api written in Javascript for centrallizing Ajax calls and returning response via Promise Object. This API is compliant with ECMA 2015 new features and syntaxs and is transpiled to ECMA 5 via Babel.
npm install base-api
Angular for ng-base-api.js
JQuery for amd-base-api.js
Include the files(as per your project requirement/technologies) and inject the module into your js files.
For Project based on AngularJS Framework
angular.module('Module1').controller('DummyController', ['BaseApiFactory', function(baseApiFactory){
baseApiFactory.get(...);
baseApiFactory.post(...);
baseApiFactory.put(...);
}]);
For Project based on AMD pattern
define(['amd-base-api-es5'], function(baseApiFactory){
baseApiFactory.get(...);
baseApiFactory.post(...);
baseApiFactory.put(...);
});