This is a simple proof-of-concept example of how one could embed Juttle-powered charts and visualizations in a custom application.
Requires node.js to be installed.
# git clone https://gist.github.com/df3d67fb36ccb5f6382c.git juttle-api-proxy
# cd juttle-api-proxy
# npm install
# npm install outrigger
# ./node_modules/.bin/webpack
# node ./node_modules/.bin/outriggerd --root / &
# node ./server.js &
Then browse to http://localhost:8080 and follow the instructions in the app.
The application implements a simple session-based login in which the "company" is specified by the app and stored in the session store.
When the "run" button is clicked, the endpoint /api/revenue/
looks up the company in the current login session and includes executes a known juttle program on the outrigger system running on localhost:8080.
Once the juttle completes, the output is massaged slightly and the data points are returned from the API request. The client-side application then takes the data and populates it into a timechart and a table.