{"id":21973642,"url":"https://github.com/alash3al/aggrex","last_synced_at":"2025-04-28T14:26:48.922Z","repository":{"id":57578414,"uuid":"129898923","full_name":"alash3al/aggrex","owner":"alash3al","description":"a crazy API gateway aggregation using javascript as a language and go as a runtime","archived":false,"fork":false,"pushed_at":"2018-07-14T07:54:40.000Z","size":25,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T10:33:39.716Z","etag":null,"topics":["aggregator","api","api-client","api-gateway","cloud","golang","javascript","mapreduce","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","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/alash3al.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-04-17T12:10:08.000Z","updated_at":"2023-12-17T22:33:05.000Z","dependencies_parsed_at":"2022-09-26T19:11:02.021Z","dependency_job_id":null,"html_url":"https://github.com/alash3al/aggrex","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alash3al%2Faggrex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alash3al%2Faggrex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alash3al%2Faggrex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alash3al%2Faggrex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alash3al","download_url":"https://codeload.github.com/alash3al/aggrex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251328632,"owners_count":21571954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aggregator","api","api-client","api-gateway","cloud","golang","javascript","mapreduce","reverse-proxy"],"created_at":"2024-11-29T15:33:48.231Z","updated_at":"2025-04-28T14:26:48.904Z","avatar_url":"https://github.com/alash3al.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"AggreX\n=======\n\u003e Just a scriptable APIs aggregator using the simple `javascript` syntax\n\n```bash\ncurl -d \"\\\nvar continent = fetch({url: 'http://country.io/continent.json'}); \\\nvar names = fetch({url: 'http://country.io/names.json'}); \\\nvar exports = {\n\tc: continent.body,\n\tn: names.body\n};\\\n\" localhost:6030\n```\n\nFeatures\n========\n- Using a simple `javascript` interpreter to execute your requests\n- Using the [`underscore.js`](http://underscorejs.org) library for helper functions\n- Stored procedures`!`\n- Procedures search engine`!`\n- Lightweight \u0026 High concurrent request dispatcher\n- Built using `Golang`\n\nWhy\n====\n\u003e I wanted a genaric way to call multiple endpoints from the browser without the ajax hell so I won't reduce the page load performance, as well as I don't want to create a customized script to aggregate the endpoints for me, I need it to be genaric.\n\nInstallation\n=============\n\u003e Just goto the [releases](https://github.com/alash3al/aggrex/releases) page and download yours\n\nUsage\n=====\n\n#### CLI Flags\n```bash\n➜  ~ aggrex -h\nUsage of aggrex:\n  -admin-token string\n        the admin secret token (default \"bbh42d0186vj9c87qdc0\")\n  -allowed-hosts all are allowed\n        the allowed hosts, empty means all are allowed\n  -http string\n        the http listen address (default \":6030\")\n  -index string\n        the database index (default \"/home/alash3al/.aggrex\")\n  -max-body-size int\n        max body size in MB (default 2)\n  -max-exec-time int\n        max execution time of each script in seconds (default 5)\n\n```\n\n#### Run\n```bash\n➜  ~ aggrex\n```\n\n#### Example\n```bash\n➜  ~ curl -d \"exports.example = fetch({url: 'http://country.io/names.json'})\" localhost:6030\n```\n\nJavascript API\n==============\n\u003e as well as the basic javascript keywords/objects there are two things `fetch()` and `_` (underscore)\n\n#### # `fetch(options)`\n```javascript\nvar resp = fetch({\n    url: \"http://localhost\",    // the url\n    method: \"GET\",              // the http method\n    headers: {                  // the request headers\n        \"key\": \"value\"\n    },\n    proxy: \"\",                  // the proxy to be used\n    redirects: 5,               // the maximum redirects count\n    body: \"\"                    // the request body (anything to be sent i.e 'string', 'object' ... etc)\n})\n\nvar statusCode = resp.statusCode\nvar headers = resp.headers\nvar size = resp.size\nvar body = resp.body\n\n// you must fill the exports variable, because this is the main var used as a response\nexports.example = body\n```\n\n### # `utils.btoa(string)`\n### # `utils.atob(string)`\n### # `utils.uniqid(integer length)`\n### # `utils.md5(string)`\n### # `utils.sha256(string)`\n### # `utils.sha512(string)`\n### # `utils.bcrypt(string)`\n### # `utils.bcryptCheck(string hashed, string real)`\n### # `utils.fetch(Object args)`\n### # `utils.collect()`, `underscore.js`\n\n### # `requests.headers` `Object`\n### # `requests.query` `Object`\n### # `requests.body` `Object`\n### # `requests.host` `String`\n### # `requests.proto` `String`\n### # `requests.remote_addr` `String`\n### # `requests.uri` `String`\n\n### # `cron.set(string key, string interval, closure job)`\n### # `cron.unset(string key)`\n### # `cron.list() Object`\n\n### # `globals` `Object`\n\n\nRESTful API [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/dac8c42fcce004c6c7e8)\n=============\n\u003e Goto the postman [documenter](https://documenter.getpostman.com/view/2408647/aggrex/RW1aJfJ8)\n\nContribution\n============\nWeclome :)\n\nAuthor\n=========\nI'm [Mohammed Al Ashaal](http://github.com/alash3al), a Gopher ;)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falash3al%2Faggrex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falash3al%2Faggrex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falash3al%2Faggrex/lists"}