Simple Axios wrapper for REST API requests. Current stable version is 2.1.7. It provides a convenient abstraction over axios for making REST API calls with built-in resource routing, delay simulation, and support for multiple API servers. Key differentiators: custom HTTP methods (cget, load, save, etc.), configurable URL templates per resource, and built-in request delay for testing UI responsiveness. Requires axios and underscore as peer dependencies. Ideal for Vue.js applications.
npm install axios-rest-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and instantiate the Api class with default resource configuration, then perform GET requests using load() and get() methods.
Initialize resources as const resources = []; then assign resources.default = {...}; resources.users = {...};For requests without id, use api.res('resource').load() instead of get().Pin axios@0.19.x and underscore@1.9.x in your package.json to avoid compatibility issues.
Always specify routing or use explicit URL as second parameter: api.res().load(null, 'https://example.com').
Ensure const resources = []; and resources.default = { host: '...' }; before passing to new Api(resources).Use import Api from 'axios-rest-api'; then const api = new Api();
Use api.res('users').get({id: 123}) or if no id needed, use .load().