routes.js
function(req, res) {
            if (!req._body || (req.body == null) || !req.body) {
                res.send(400, "Invalid POST missing required request body.");
                return;
            }
            if ((req.body.model == null) || !req.body.model) {
                res.send(400, "Invalid POST missing 'model' property in request body.");
                return;
            }
            var onmDataModelRecord = onmModelDictionary[req.body.model];
            if ((onmDataModelRecord == null) || !onmDataModelRecord || (onmDataModelRecord.model == null) || !onmDataModelRecord.model) {
                res.send(403, "The specified onm data model '" + req.body.model + "' is unsupported by this server.");
                return;
            }
            var storeUuid = uuid.v4();
            var store = onmStoreDictionary[storeUuid] = new onm.Store(onmDataModelRecord.model);
            var storeRecord = {
                dataModel: store.model.jsonTag,
                storeKey: storeUuid
            };
            console.log("created in-memory data store '" + storeUuid + "'.");
            res.send(200, storeRecord);
        }
function(req, res) {
            if (!req._body || (req.body == null) || !req.body) {
                res.send(400, "Invalid POST missing required request body.");
                return;
            }
            if ((req.body.model == null) || !req.body.model) {
                res.send(400, "Invalid POST missing 'model' property in request body.");
                return;
            }
            var onmDataModelRecord = onmModelDictionary[req.body.model];
            if ((onmDataModelRecord == null) || !onmDataModelRecord || (onmDataModelRecord.model == null) || !onmDataModelRecord.model) {
                res.send(403, "The specified onm data model '" + req.body.model + "' is unsupported by this server.");
                return;
            }
            var storeUuid = uuid.v4();
            var store = onmStoreDictionary[storeUuid] = new onm.Store(onmDataModelRecord.model);
            var storeRecord = {
                dataModel: store.model.jsonTag,
                storeKey: storeUuid
            };
            console.log("created in-memory data store '" + storeUuid + "'.");
            res.send(200, storeRecord);
        }
function ( req , res ) { if ( ! req . _body || ( req . body == null ) || ! req . body ) { res . send ( 400 , "Invalid POST missing required request body." ) ; return ; } if ( ( req . body . model == null ) || ! req . body . model ) { res . send ( 400 , "Invalid POST missing 'model' property in request body." ) ; return ; } var onmDataModelRecord = onmModelDictionary [ req . body . model ] ; if ( ( onmDataModelRecord == null ) || ! onmDataModelRecord || ( onmDataModelRecord . model == null ) || ! onmDataModelRecord . model ) { res . send ( 403 , "The specified onm data model '" + req . body . model + "' is unsupported by this server." ) ; return ; } var storeUuid = uuid . v4 ( ) ; var store = onmStoreDictionary [ storeUuid ] = new onm . Store ( onmDataModelRecord . model ) ; var storeRecord = { dataModel : store . model . jsonTag , storeKey : storeUuid } ; console . log ( "created in-memory data store '" + storeUuid + "'." ) ; res . send ( 200 , storeRecord ) ; }
Create a new in-memory data store instance using the the indicated onm data model.
Create a new in - memory data store instance using the the indicated onm data model .