5 releases
0.0.5 | May 23, 2024 |
---|---|
0.0.4 | May 20, 2024 |
0.0.3 | Mar 29, 2024 |
0.0.2 | Mar 24, 2024 |
0.0.1 | Mar 10, 2024 |
#1281 in Web programming
398 downloads per month
6.5MB
4.5K
SLoC
http-diff
CLI tool to verify consistency across web server versions. Ideal for large-scale refactors, sanity tests and maintaining data integrity across versions.
Archives of precompiled binaries for http-diff are available for macOS and Linux on every release.
Dual-licensed under MIT or the UNLICENSE.
The tool works by looking at the configuration file that can be specified by --configuration
argument.
http-diff --configuration=./configuration.json
./configuration.json
- is the default value for this argument so it can be omitted.
Config example:
{
"domains": ["http://domain-a.com", "http://stage.domain-a.com"],
"endpoints": [
{
"endpoint": "/health"
},
{
"endpoint": "/api/v1/users/<userId>"
}
],
"variables": {
"userId": [123, 444]
}
}
this config will be translated to following:
-
GET
request will be issued tohttp://domain-a.com/health
and response be compared to response ofGET http://stage.domain-a.com/health
. -
Next endpoint
/api/v1/users/<userId>
has variable defined in it -<userId>
. Anything within the brackets considered a variable name. In this case -userId
. Variable then is looked up in the global variables property. In this caseuserId
has two values:123
and444
. This will be mapped to following requests:GET http://domain-a.com/users/123
and compared with response fromGET http://stage.domain-a.com/users/123
.GET http://domain-a.com/users/444
and compared withGET http://stage.domain-a.com/users/444
.
All configuration options can be found here.
Installation
Archives are available on every release as well as .deb
files for Linux.
Autocomplete for arguments and man pages are included.
(brew tap) Apple & Linux
Tap the repository by running this command:
brew tap syte-ai/http-diff https://github.com/syte-ai/http-diff
and install the package:
brew install http-diff
.deb file for Linux
Download .deb
file from latest release and install it using one of the commands:
sudo apt install ./path/to/http-diff.deb
or
sudo dpkg -i ./path/to/http-diff.deb
Developing
cargo run
- for developmentcargo test
- to run testscargo build -r
- to build in release mode
Dependencies
~19–41MB
~601K SLoC