KATT player is a mock HTTP server that replies with HTTP responses based on KATT blueprints.
KATT blueprints describe a scenario as a sequence of HTTP requests and responses (the pair is called an HTTP transaction).
KATT player instantiates an HTTP server that loads these scenarios and, given a reference to one of them, it can respond to a HTTP request with the HTTP response prescribed by the referenced scenario.
The HTTP response is decided by a KATT player engine. Two engines are built-in:
one that validates the incoming requests against the blueprint (
and one that doesn't and just blindly replies with the consecutive response
linear). The former is the default.
These two engines will look at
katt_scenarioto decide which scenario to focus on (e.g. basename of the scenario)
katt_transactionto decide the request to match against and which response is suitable (defaults to 0)
Both engines will automatically set a response header
Set-Cookie in order
to advance the transaction count.
linear-check engine can have the validation turned off temporarily via a
You can see an example here.
Custom engines may be implemented in order to add support for dealing with KATT recall structures, for example.
There are no restrictions or requirements at all.
# NPM distributionnpm install katt-player# GIT sourcegit clone --recurse-submodules [THIS_REPO_URL]npm install
katt-player [--engine=linear] [--port=1337] FOLDER # default engine is linear, port is 1337katt-player [--engine=linear] [--port=1337] FILE1 FILE2 # accepts blueprints as wellkatt-player --engine=path/to/engine.js FOLDER # use a custom engineNODE_ENV=development katt-player FOLDER # enable logging to console, instead of console.log
kattPlayer = require 'katt-player'app = kattPlayer kattPlayerengineslinearappload 'FOLDER''FILE1''FILE2'applisten 1337