Files
dougal-software/lib/www/server/queues/asaqc/dummy_server/index.js
D. Berge 0f447fc27d Add ASAQC API mock-up.
To be used for testing and debugging. See
index.js for instructions.
2021-10-04 02:21:00 +02:00

30 lines
801 B
JavaScript
Executable File

#!/usr/bin/node
/**
* A minimalist mock-up of the ASAQC server, used
* for testing.
*
* Use the following environment variables to
* configure its behaviour:
*
* ASAQC_DUMMY_OUTPUT_DIR Path to a directory in which
* to store the received data. If not provided, the
* data will be discarded but the API will still return
* a success code. Alternatively, a path may be given
* in the command line.
*
* See also api/index.js for other environment
* variable options.
*
* Example command line:
*
* HTTPS_CA="./certs/client.pem" HTTPS_PEM="./certs/dougal.pem" ./index.js ./store
*
*/
const api = require('./api');
const OUTPUT_DIR = process.argv[2] || process.env.ASAQC_DUMMY_OUTPUT_DIR;
const server = api.start(process.env.HTTP_PORT || 3077, process.env.HTTP_PATH, {OUTPUT_DIR});