Skip to content

stefancosquer/api-sniffer

Repository files navigation

API Sniffer Logo

API Sniffer Badge Quality Gate Status

API Sniffer is a simple tool to trace API calls between 2 backends.

All you need is to deploy API Sniffer and route all API calls you want to trace through it.

Running

Locally

Use the package manager npm to install dependencies.

$ npm i
$ npm run build
$ npm run start

With Docker

$ docker build -t api-sniffer .
$ docker run -p 8080:8080 -ti --rm api-sniffer

Or with Docker Compose

$ docker-compose up

App Engine

$ gcloud init
$ gcloud app deploy

Usage

Tracing API calls

In order to trace API calls, you need to route them trought the embedded proxy.

To proxify a call, change the API URL as follows:

Original URL

https://example.com/api/v1/endpoint

Proxified URL

http://localhost:8080/proxy/example.com/api/v1/endpoint

Viewing API calls

Open http://localhost:8080 to view the app in the browser.

The exchanges list will be refreshed in realtime as API calls go through API Sniffer.

Screenshot

Development

To run the development server with live reloading

$ npm run dev

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT