Whiteflag API Static Components
static/ contains static data provided by the API when running.
This data consists of the Whiteflag API definition, a socket listener for
Whiteflag messages and a Whiteflag signs and signals icon set. The server
provides the static content on the
/ root endpoint, e.g.
In addition, protocol specific static content, such as json schemas, are in
lib/protocol/static. The server provides the static protocol data on the
/protocol endpoint, e.g.
Other static data in
static subdirectories may also exists, but this data is
not provided by the server to clients. For example, there is also a
test/static/ directory, which contains static data for testing, such as the
JSON core schema meta-schema to validate the Whiteflag JSON schemas, which is
done by the
test/static.js test script.
Whitflag API Definition
The API definition is specified in
static/openapi.json in accordance with the
OpenAPI specification. The
to render the API defintion into a human readible webpage.
Redoc is not maintained as an NPM package and the following files must therefore be manually be updated from the source repository (see the Redoc documentation):
Whitflag API Message Listener
A simple web based message listener is available in
server provides the listener on the
http://localhost:5746/listen. The listener uses the socket.io
socket that is provided by the API on the
index.html loads the client side scripts
/listen/listener.js to connect the browser to the API socket on the
endpoint, displaying incoming messages directly on the web page.
An icon set for Whiteflag signs and signals can be found in
The server provides the icons under the
The icons names have the following convention:
<message code><subject code>.png.
The icons set does not currently cover all signs and signals from the Whiteflag protocol specification.