'use strict';
module.exports = {
type: 'service', //either a service or a daemon
prerequisites: { //object that is used when deploying the service of daemon in HA mode
cpu: '',
memory: ''
},
serviceVersion: 1, //service version
serviceName: "jsconf3", //service name
serviceGroup: "JSConf", //service group
servicePort: 4113, //service port
requestTimeout: 30, //time needed before timeout
requestTimeoutRenewal: 5, //how many retries before giving up on request
extKeyRequired: true, //set to true is service is multi-tenant
oauth: true, //set to true if service is secured by oauth
"errors": { //object that contains the error codes of the service
600: "Database Error"
},
"schema": { //object that contains the APIs schema
"/hello": { //one API
"_apiInfo": { // API label
"l": "Hello World",
"group": "Hello",
"groupMain": true
},
"name": { //API input
"source": ['query.name'],
"required": false,
"default": "John Doe",
"validation": {
"type": "string"
}
},
"email": { //API input
"source": ['query.email'],
"required": true,
"validation": {
"type": "string",
"format": "email"
}
}
},
"/standalone/add": {
"_apiInfo":{
"l": "Add Info to Standalone DB",
"group": "Information",
"groupMain": true
},
"username": {
"source": ['body.username'],
"required": true,
"validation": {
"type": "string",
"minLength": 4, //minimum length of username
"maxLength": 8, //maximum length of username
"pattern": /^[a-zA-Z][0-9a-zA-Z_\-]+$/ //regex to determine if username is valid or not
}
},
"name": {
"source": ['body.name'],
"required": false,
"default": "anonymous",
"validation": {
"type": "string"
}
},
"email": {
"source": ['body.email'],
"required": true,
"validation": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {"type": "string", "format": "email", "required": true},
"primary": {"type": "boolean", "required": true}
}
},
"minItems": 1, //minimum number of parameters passed in /standalone/add query string
"maxItems": 5, //maximum number of parameters passed in /standalone/add query string
"uniqueItems": true //prevents duplicate ojects
}
}
}
}
}; |