{"id":21059114,"url":"https://github.com/ganeshrvel/axios-isomorphic-routing","last_synced_at":"2026-05-15T18:03:12.362Z","repository":{"id":39576888,"uuid":"132023426","full_name":"ganeshrvel/axios-isomorphic-routing","owner":"ganeshrvel","description":"Advanced Router Controller for Vue.js, React.js \u0026 Node.js Isomorphic apps","archived":false,"fork":false,"pushed_at":"2023-01-14T00:20:26.000Z","size":1143,"stargazers_count":1,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T15:40:53.808Z","etag":null,"topics":["api","axios","es6","isomorphic","javascript","nodejs","routing","universal-app"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ganeshrvel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-03T16:40:49.000Z","updated_at":"2020-09-06T17:20:27.000Z","dependencies_parsed_at":"2023-02-09T18:00:39.834Z","dependency_job_id":null,"html_url":"https://github.com/ganeshrvel/axios-isomorphic-routing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ganeshrvel/axios-isomorphic-routing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Faxios-isomorphic-routing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Faxios-isomorphic-routing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Faxios-isomorphic-routing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Faxios-isomorphic-routing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganeshrvel","download_url":"https://codeload.github.com/ganeshrvel/axios-isomorphic-routing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshrvel%2Faxios-isomorphic-routing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","axios","es6","isomorphic","javascript","nodejs","routing","universal-app"],"created_at":"2024-11-19T17:09:56.954Z","updated_at":"2026-05-15T18:03:12.330Z","avatar_url":"https://github.com/ganeshrvel.png","language":"JavaScript","funding_links":["https://paypal.me/ganeshrvel"],"categories":[],"sub_categories":[],"readme":"# Axios Isomorphic Routing Controller\n\n- Author: [Ganesh Rathinavel](https://www.linkedin.com/in/ganeshrvel \"Ganesh Rathinavel\")\n- License: [MIT](https://github.com/ganeshrvel/axios-isomorphic-routing/blob/master/LICENSE \"MIT\")\n- Repo URL: [https://github.com/ganeshrvel/axios-isomorphic-routing](https://github.com/ganeshrvel/axios-isomorphic-routing \"https://github.com/ganeshrvel/axios-isomorphic-routing\")\n- Contacts: ganeshrvel@outlook.com\n- Requirements: Node.js v6+ or higher, npm\n\n##### Advanced Router Controller for Vue.js, React.js \u0026 Node.js Isomorphic apps\n\n#### Why **Axios Isomorphic Routing Controller**?\n\u003e Axios is a Promise-based HTTP client for JavaScript which can be used for both Frontend and Backend Applications.\n\u003e Although the library is very powerful we often run into situations where we wish it'd offered us more and that's the motivation behind this project.\n\n### Features\n- Cache for both server and client side.\n- LRU for the server and localforage for the client.\n- Warm cache which refreshes at a regular interval of time.\n- Independent routing for both Server and client.\n- Advanced routing with predefined or dynamic endpoints and action methods.\n- Caching available for every endpoint, method, query string, parameters and body data.\n- Purge and rebuild the cache on the fly.\n\n\n### Installation\n```shell\n$ git clone --depth 1 --single-branch --branch master https://github.com/ganeshrvel/axios-isomorphic-routing.git\n    \n$ cd axios-isomorphic-routing\n```\n\t\n### Run\n```shell\n$ npm install\n    \n$ npm run start\n```\n\n- App launch address: [http://localhost:3001/](http://localhost:3001/ \"http://localhost:3001/\")\n\n- For Server side Axios routing demo: [http://localhost:3001/demo/server](http://localhost:3001/demo/server \"http://localhost:3001/demo/server\")\n\n- For Client side Axios routing demo: Fire up the browser console.\n\n\n### Structure\n\n    |-- axios-isomorphic-routing\n        |-- server.js\n        |-- express\n        |   |-- routes.js\n        |   |-- mock-data\n        |-- src\n            |-- index.html\n            |-- index.js\n            |-- api\n            |   |-- consts.js\n            |   |-- end-points.js\n            |   |-- index.js\n            |   |-- services\n            |       |-- client-api.js\n            |       |-- index.js\n            |       |-- server-api.js\n            |-- examples\n                |-- client.js\n                |-- server.js\n\n### General Information\n\n**server.js**: Node entry point\n\n**express/routes.js**:\nServer endpoint router. Codes for GET/POST/PUT/DELETE routing is written here.\nThe JSON values are fetched from 'express/mock-data/*.json' files.\n\n**src/index.html**: Template file.\n**src/index.js**: Client-side entry point.\n\n**src/api/const.js**: Configure the constant values for the app here.\n**src/api/end-points.js**: Endpoints are mapped here. The app later fetches the endpoint data from here.\n**src/api/end-points.js**: Main controller file.\n**src/api/services**: Server and client data flow routing and controller\n\n**src/examples**: Demo for both server and client side Axios routing and method usage.\n\n\n### Usage\n    // import make() method from api\n    const {make} = require('../src/api')\n    \n```javascript\n /**\n   * @param request: The end point to hit; Find the endpoint reference from 'end-points.js'\n   * @param queryString: Query string or parameters to hit the API,\n   * @param data: Body data for POST and PUT action types; No data is accepted by GET or DELETE\n   * @param allowCache: Allow the caching of output data; It will be different for different query string parameters. Or read from an already cached record.\n   * @param rebuildCache: Purge the old cache and fetch the new data\n   * @param allowDataCache: Allow the caching of the POST body data.\n   *  Eg: Various combinations of post parameters along with the respective output can be cached for an ecommerce/classified website options filter. This saves a massive amount of API calls by caching previous records of the filter combinations.\n   * @param ...args: {customEndPoint}\n   * customEndPoint =\u003e Dynamically generated end points along with url and method\n   * @returns Promise\n   */\n   \n  make({\n    request,\n    queryString,\n    data,\n    allowCache,\n    rebuildCache,\n    allowDataCache,\n    customEndPoint,\n  }).\n  then(response =\u003e {\n  })\n```\n\n**param: allowCache**\n\n```javascript\n/**\n   * Supported action types: GET/POST/PUT/DELETE\n   * */\n  \n  make({\n    request: 'GET_CARS',//will be translated as 'cars/'(go through 'end-points.js' for more)\n    queryString: '?start=2008\u0026end=2010',//will be translated as 'cars/?start=2008\u0026end=2010'\n    data: {}, //No data is accepted for GET method\n    allowCache: true,\n    rebuildCache: false,\n    allowDataCache: false,//Only availble for POST\n    customEndPoint: null,\n  }).then(response =\u003e {\n    console.log(response)\n  })\n  \n  //Identical call to demonstrate the working of cache\n  setTimeout(() =\u003e {\n      make({\n        request: 'GET_CARS',\n        queryString: '?start=2008\u0026end=2010',\n        data: {},\n        allowCache: true,\n        rebuildCache: false,\n        allowDataCache: false,\n        customEndPoint: null,\n      }).then(response =\u003e {\n        console.log(response)\n      })\n    },\n    4000)\n  \n  //Different query string while the other parameters are same as above.\n  //The cache will be different for different query string parameters\n  setTimeout(() =\u003e {\n      make({\n        request: 'GET_CARS',\n        queryString: '?start=1950\u0026end=2000', //Query string is changed here\n        data: {},\n        allowCache: true,\n        rebuildCache: false,\n        allowDataCache: false,\n        customEndPoint: null,\n      }).then(response =\u003e {\n\t  \tconsole.log(response)\n      })\n    },\n    6000)\n```\n\n**param: allowDataCache**\n\n```javascript\n/**\n   * Supported action type: POST\n   * */\n  \n  //Begin caching of body data\n  make({\n    request: 'POST_TEST2',//will be translated as 'test_cache2/'(go through 'end-points.js' for more)\n    queryString: '?param1=12345\u0026param2=abcdef',//will be translated as 'test_cache2/?param1=12345\u0026param2=abcdef'\n    data: {'planet1': 'mars', 'planet2': 'jupiter'},\n    allowCache: true,\n    rebuildCache: false,\n    allowDataCache: true,\n    customEndPoint: null,\n  }).then(response =\u003e {\n    console.log(response)\n  })\n  \n  // The above data is cached for the particular POST parameters\n  // and the below function will refetch the same from the cache generated from the above code\n  setTimeout(() =\u003e {\n    make({\n      request: 'POST_TEST2',\n      queryString: '?param1=12345\u0026param2=abcdef',\n      data: {'planet1': 'mars', 'planet2': 'jupiter'}, //identical post body data as the above\n      allowCache: true,\n      rebuildCache: false,\n      allowDataCache: true,\n      customEndPoint: null,\n    }).then(response =\u003e {\n      console.log(response)\n    })\n  }, 4000)\n  \n  //Different post body data while the other parameters are same as above.\n  //The cache will be different for different post parameters\n  setTimeout(() =\u003e {\n    make({\n      request: 'POST_TEST2',\n      queryString: '?param1=12345\u0026param2=abcdef',\n      data: {'planet1': 'earth', 'planet2': 'venus'}, //different post body data from the above\n      allowCache: true,\n      rebuildCache: false,\n      allowDataCache: true,\n      customEndPoint: null,\n    }).then(response =\u003e {\n      console.log(response)\n    })\n  }, 6000)\n```\n\n```javascript\n/**\n   * Supported action types: GET/POST/PUT/DELETE\n   */\n   \n    //Few random end points\n    //Note: apiUrl and method has to be supplied to customEndPoint as an object\n  let endPointDictionary = [\n      {\n        apiUrl: 'try_put',\n        method: 'PUT',\n      },\n      {\n        apiUrl: 'try_delete',\n        method: 'DELETE',\n      },\n    ]\n  \n  make({\n    request: 'CUSTOM_ENDPOINT_1',\n    queryString: '?param1=12345\u0026param2=abcdef',\n    data: {},\n    allowCache: true,\n    rebuildCache: false,\n    allowDataCache: false,\n    customEndPoint: endPointDictionary[0],\n  }).then(response =\u003e {\n    console.log(response)\n  })\n  \n  make({\n    request: 'CUSTOM_ENDPOINT_2',\n    queryString: '?param1=12345\u0026param2=abcdef',\n    data: {},\n    allowCache: true,\n    rebuildCache: false,\n    allowDataCache: false,\n    customEndPoint: endPointDictionary[1],\n  }).then(response =\u003e {\n   console.log(response)\n  })\n\n```\n\n**Warm cache**:\n\u003e \n- 'warmCacheList' as defined in: 'src/api/consts.js'\n- Warm cache refresh list;\n- Allowed Methods: GET\n- These are loaded when the server fires up and keeps refreshing every 'WARM_CACHE_REFRESH_TIME' seconds.\n- The list will keep getting updated at a regular interval.\n- Usage: Website wide data caching.\n- Scope: Server only. Client can't access this data.\n- To over ride the Warm cache allowCache can be set false while making the API call.\n- Important: DO NOT add the APIs used for fetching personal user data.\n\n\n### Dummy API end-points:\n\n    http://localhost:3001/cars?start=2005\u0026end=2010\n    Method type: GET\n    \n    http://localhost:3001/cities\n    Method type: POST\n    POST data: {\"countries\": \"China\", \"limit\": 2}\n    \n    http://localhost:3001/try_put\n    Method type: PUT\n    POST data: {\"param1\": \"12345\", \"param2\": \"abcdefg\"}\n    \n    http://localhost:3001/try_delete\n    Method type: DELETE\n    POST data: {\"param1\": \"12345\", \"param2\": \"abcdefg\"}\n    \n    http://localhost:3001/test_cache1?param1=animals\u0026param2=plants\n    Method type: GET\n    \n    http://localhost:3001/test_cache2?param1=animals\u0026param2=plants\n    Method type: POST\n    POST data: {\"planet1\": \"mars\", \"planet2\": \"jupiter\"}\n\n### Changelogs:\n##### v1.0:\n- Compiled README.md\n- Cleaned a few lines of code and documentation.\n\n##### v0.1:\n- Development\n- Initial commit\n\n### Dependencies\n- Axios\n- bluebird\n- localforage\n- lru-cache\n\n\n ### Contribute\n- Fork the repo and create your branch from master.\n- Update the documentation if needed.\n- Issue a pull request!\n\nWhen you submit code changes, your submissions are understood to be under the same [MIT License](https://github.com/ganeshrvel/axios-isomorphic-routing/blob/master/LICENSE \"MIT License\") that covers the project. Feel free to contact the maintainers if that's a concern.\n\n\n### Buy me a coffee\nHelp me keep the app FREE and open for all.\nPaypal me: [paypal.me/ganeshrvel](https://paypal.me/ganeshrvel \"paypal.me/ganeshrvel\")\n\n\n### Contacts\nPlease feel free to contact me at ganeshrvel@outlook.com\n\n\n### License\naxios-isomorphic-routing | Advanced Router Controller for Vue.js, React.js \u0026 Node.js Isomorphic apps is released under [MIT License](https://github.com/ganeshrvel/axios-isomorphic-routing/blob/master/LICENSE \"MIT License\").\n\nCopyright © 2018-Present Ganesh Rathinavel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshrvel%2Faxios-isomorphic-routing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganeshrvel%2Faxios-isomorphic-routing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshrvel%2Faxios-isomorphic-routing/lists"}