This module provides a Swish store in the browser that forwards requests over HTTP to a Swish store on the server.
In the browser
client.js can be included on its own (where it will register the global class
SwishHttp). If used from AMD or CommonJS it will define a module, e.g.
var SwishHttp = ;
To set up a store, provide the URL endpoint:
var store = '/json/my-store';
On the server
The main module (
index.js) provides the counterpart for the server. You construct the a wrapper using an existing Swish store:
var wrapper = store;
You can then register this as an Express middleware at the appropriate location:
The tests run in the browser. There is an Express-based test server in
The test page/server creates a fresh store for each test, and has no cleanup, so the test server should not run indefinitely.
You can start this server using
npm run test-server.
If you append the fragment
#stopOnFirst to the page, it will halt at the first failed test, instead of continuing testing.