-
npm i
-
for each subfolder with code:
npm install
-
npm install -g node-windows : For the windows service registration
-
npm link node-windows
-
open cmd as Administartor
-
node runSchemaServerAsAService.js - Make sure the path in the file match the location
Create SQL script to transform one schema to another.
Call as:
transform(oldSchema, newSchema, severity)
Obtains two JSON schemes:
-
oldSchema
- json -
newSchema
- json -
severity
-- 0 - validate transform based on schemes only
- 1 - validate transform based on schemes and current data
Returns: json wih three fields:
- valid: string - "always" - perfectly valid, "data" - valid with warnings, depends on actual data, "never" - invalid,
- warnings: <array of strings of warnings/errors>
- alter:
Test if a JSON schema is valid.
Call as:
validateSchema(str)
Obtains:
str
- string representing schema in JSON
Returns: json wih two fields:
- valid: boolean
- warnings: <array of strings of warnings/errors>
You can test calls using http-console
http-console --json http://localhost:8080
To make a POST call:
post transform
{ "oldSchema": [], "newSchema": [], "severity": 1 }
Fill the oldSchema and newSchema as desired.
-
use config file:
var config = require('../configFactory').getConfig();
-
use our logger:
var logger = require('./logging/logger').getLogger("schema_" + config.env);
add logging statements:
logger.info("....");
-
AWS IAM Credentials:
var credentials = require('../hosting/credentials').credentials;
-
Shutdown logging in
logging/config.json
, by changing this line:"tests": "DEBUG"
into:
"tests": "OFF"