Http Replay Server
This repository contains the source code to a server that allows you to intercept http requests and responses from the real server, store them to text files, and then send the cached responses back to client for repetitive requests.
The Key Ideas Behind the Http Replay Server
You can find the details here.
Overview of Folder Structure
lib contains the source code for the Http Replay Server.
test-server.jsis the main entry point to http replay server.
test contains the sample code to set up test server, fake real server, and test client.
server-config.jscontains the configuration for servers.
setup-servers.jscontains the code to setup a test server and a fake real server.
run-client-tests.jscontains the code to make http requests to the test server.
There isn't a npm package for Http Replay Server yet, you have to get the git repository, and then run
See the Test Server in Action
In your command line consoles, run the following steps:
- Go to
node setup-servers.jsto start a test sever and a fake real server.
node run-client-tests.jsto start a http client that makes requests to the test server.
- In the
setup-serverconsole, it shows the output from the test server and the fake real server.
- In the
run-client-testsconsole, it shows the responses from the test server.
- The data cached by the test server is stored as text files in
test-server\db-files. The folder can be changed in