-
Notifications
You must be signed in to change notification settings - Fork 7
HAPI server conventions
Bob Weigel edited this page Dec 22, 2025
·
2 revisions
If server starts from command line, use, hapiserver, -p, and -c
hapiserver -p PORT -c CONFIG
and ideally
hapiserver --port PORT --config CONFIG
(If not, for example for case where WAR file ..., ignore above.)
Discuss caching options. Other optimizations. Last modified.
Not a requirement or mandate. But useful if server implementations use.
If you are looking to not reinvent, could use.
{
"about": {}
// Style is not decided upon yet.
"catalog_file": path to JSON file
or
"catalog_inline": {JSON}
// Error if more than one catalog method given
e.g.,
"catalog_command": "node catalog.js" // could be any c/l program that returns {JSON}
"catalog_command": "python catalog.py"
"catalog_command": "cat /tmp/catalog.json"
Misconfig of server (catalog.json does not exist, exit(not zero)) => Server creates and writes 500 JSON
Misconfig of server (cat cmd does not exist, exit(not zero)) => Send creates and writes 500 JSON
"info_command": "python info.py --dataset {DATASET}" // Always sends back all parameters, server subsets.
"data_command": "python data.py --dataset {DATASET}"
"data_command": "python data.py --dataset {DATASET} --parameters {PARAMETERS}"
"data_command": "python data.py --dataset {DATASET} --parameters {PARAMETERS} --start {START} --stop {STOP}"
}