COMMON PACKAGE
This is the common package for all SPARC servers and products. Right now it contains the following things:
- logger - based on log4js
- resources - based on needle
- utils - all the rest of the crap, including a function to load handlebar templates
The library expects to find a configuration file in the config/ folder of the root project. Following is an example of such configuration file
{
"version": "0.2.4",
"logging": {
"appenders": [
{
"type": "console",
"layout": {
"type": "pattern",
"pattern": "[%d %p %c] %m"
}
}
],
"levels": {
"[all]": "DEBUG"
},
"replaceConsole": "true"
},
"resource": {
"test_resource": {
"method": "get",
"url": "http://bogus.com",
"uri": {
"boguservice": "bellobell",
"boguservice2": "gallogall"
},
"api-params": {
"apikey": "asdfg"
}
}
}
}
For the logger configuration please refer to log4js documentation.
Resources is pretty straightforward