Just a scriptable APIs aggregator using the simple
javascript
syntax
curl -d "\
var continent = fetch({url: 'http://country.io/continent.json'}); \
var names = fetch({url: 'http://country.io/names.json'}); \
var exports = {
c: continent.body,
n: names.body
};\
" localhost:6030
- Using a simple
javascript
interpreter to execute your requests - Using the
underscore.js
library for helper functions - Stored procedures
!
- Procedures search engine
!
- Lightweight & High concurrent request dispatcher
- Built using
Golang
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.
Just goto the releases page and download yours
➜ ~ aggrex -h
Usage of aggrex:
-admin-token string
the admin secret token (default "bbh42d0186vj9c87qdc0")
-allowed-hosts all are allowed
the allowed hosts, empty means all are allowed
-http string
the http listen address (default ":6030")
-index string
the database index (default "/home/alash3al/.aggrex")
-max-body-size int
max body size in MB (default 2)
-max-exec-time int
max execution time of each script in seconds (default 5)
➜ ~ aggrex
➜ ~ curl -d "exports.example = fetch({url: 'http://country.io/names.json'})" localhost:6030
as well as the basic javascript keywords/objects there are two things
fetch()
and_
(underscore)
var resp = fetch({
url: "http://localhost", // the url
method: "GET", // the http method
headers: { // the request headers
"key": "value"
},
proxy: "", // the proxy to be used
redirects: 5, // the maximum redirects count
body: "" // the request body (anything to be sent i.e 'string', 'object' ... etc)
})
var statusCode = resp.statusCode
var headers = resp.headers
var size = resp.size
var body = resp.body
// you must fill the exports variable, because this is the main var used as a response
exports.example = body
Goto the postman documenter
Weclome :)
I'm Mohammed Al Ashaal, a Gopher ;)