command module
v1.0.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2018 License: MIT Imports: 13 Imported by: 0



Just a scriptable APIs aggregator using the simple javascript syntax

curl -d "\
var continent = request({url: ''}); \
var names = request({url: ''}); \
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
  • 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


CLI Flags
➜  ~ aggrex -h
Usage of aggrex:
  -allowed-hosts all are allowed
    	the allowed hosts, empty means all are allowed
  -http string
    	the http listen address (default ":6030")
  -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 = request({url: ''})" localhost:6030

Javascript API

as well as the basic javascript keywords/objects there are two things request() and _ (underscore)

# request(options)
var resp = request({
    url: "http://localhost",    // the url
    method: "GET",              // the http method
    headers: {                  // the request headers
        "key": "value"
    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


Weclome :)


I'm Mohammed Al Ashaal, a Gopher ;)


The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL