Track, transform and analyze the traffic between your app and the APIs you use.
Lua CoffeeScript Ruby HTML CSS Perl Other
Latest commit 229dc0f Oct 14, 2015 @mikz mikz Merge pull request #56 from APItools/smart-router
introduce smart router on port 8080
Permalink
Failed to load latest commit information.
app do not require pairing with the global dashboard Oct 14, 2015
config Merge pull request #56 from APItools/smart-router Oct 14, 2015
doc [docs] rack request/response documentation Dec 3, 2014
features Merge branch 'master' into on-premise Jan 5, 2015
lib import whole repository Sep 25, 2014
logs import whole repository Sep 25, 2014
lua Merge pull request #56 from APItools/smart-router Oct 14, 2015
luarocks import whole repository Sep 25, 2014
public import whole repository Sep 25, 2014
script change in script/resty for linux Apr 8, 2015
spec Merge branch 'master' into on-premise Jan 5, 2015
tasks Merge branch 'on-premise' into merge-on-premise Oct 14, 2015
test import whole repository Sep 25, 2014
tmp import whole repository Sep 25, 2014
vendor/cache [gemfile] update jor & redis & hiredis Oct 14, 2015
.agignore import whole repository Sep 25, 2014
.bowerrc import whole repository Sep 25, 2014
.dockerignore import whole repository Sep 25, 2014
.env generate aof file on demand when doing backup Nov 25, 2014
.env.test import whole repository Sep 25, 2014
.gitignore package gems to vendor/cache for faster install Nov 17, 2014
.travis.yml [travis] use nginx instead of openresty binary Oct 14, 2015
CONTRIBUTING.md import whole repository Sep 25, 2014
Dockerfile Revert "update dockerfile to trusty+nginx 1.7.10.1" Jun 5, 2015
Gemfile [gemfile] update jor & redis & hiredis Oct 14, 2015
Gemfile.lock [gemfile] update jor & redis & hiredis Oct 14, 2015
Guardfile [guard] guard runs nginx too Oct 14, 2015
LICENSE.txt APItools Monitor Release 201406101055 Jun 10, 2014
Makefile document development environment and allow fig Nov 28, 2014
Procfile Modify Procfile to use nginx instead of openresty executable Apr 8, 2015
README.md Fixed some minor typos and grammatical errors Aug 31, 2015
Rakefile import whole repository Sep 25, 2014
Vagrantfile travis & vagrant build Nov 17, 2014
bower.json import whole repository Sep 25, 2014
config.ld [docs] rack request/response documentation Dec 3, 2014
fig.yml use statsd docker image to show internal metrics Nov 28, 2014
package.json import whole repository Sep 25, 2014
release.rb do not enable realip logging on-premise and release to github Jan 5, 2015
release.yml do not enable realip logging on-premise and release to github Jan 5, 2015

README.md

APItools Traffic Monitor Build Status

APITools is a hosted proxy mainly for API calls, but can be used as a general programmable proxy. It has analytics, lua middleware, storing passed calls and many other features.

Building and Developing

You need Ruby 2.1.2 to build this project and Openresty to run it. Then you can just run it like:

bundle
foreman start

If you want to know how exacly each component is started, check Procfile.

You will need a running redis server.

Tests

We have several test suites for different components. First are the API tests that require ruby. You can run them by rake test:api. You need to have an instance running on ports 7071 and 10002. Then there is rake test:integration which runs cucumber tests with real browsers simulating user interactions. Next are rake test:lua which are lua tests. They require openresty version at least 1.7.4.1. Last are Angular tests, that require nodejs. You can install all dependencies by npm install and then just rake test:angular.

Docker

You can use fig to start the developer environment. Or you can use our make bash to start similar environment without fig.

Installing Openresty

Installing Openresty on OSX

Install homebrew

brew tap apitools/openresty
brew install openresty
brew install apitools/openresty/luarocks

luarocks install luajson
luarocks install luaexpat

bundle install
npm install
foreman start

# For tests:
luarocks intall busted-stable

Linux

You can follow our Dockerfile with exact commands on how to install Openresty on Linux. You don't have to use all the flags or prefixes. The essense should be:

wget http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz
tar xzf ngx_openresty-1.7.2.1.tar.gz
cd ngx_openresty-1.7.2.1
./configure --with-luajit-xcflags=-DLUAJIT_ENABLE_LUA52COMPAT --with-http_gunzip_module
make
sudo make install

For SSL of HTTP client you need ngx_openresty-1.7.4.1rc2, apply our patch like:

curl https://gist.githubusercontent.com/mikz/4dae10a0ef94de7c8139/raw/
33d6d5f9baf68fc5a0748b072b4d94951e463eae/system-ssl.patch | patch -p0

and then configure and build like usual.

Install Guide

You can find the full Install Guide in our documentation.

Debian/Ubuntu

Use our packages available from https://packagecloud.io/APItools/monitor.

OSX

Follow Installing Openresty on OSX to get Openresty running. Then you can use a release or build it yourself.

Running it

nginx -p /path/to/folder -c config/nginx.conf

OSX

On OSX, instead of nginx use openresty.

Contributing

We accept Pull Requests, but please check before doing so if it meets the target of this project.

For contributing guide check CONTRIBUTING.md.