update to latest yang-express and adapt api/server to specify controller/view
diff --git a/package.json b/package.json
index 14e4cb3..ebd2a59 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "yang-cord",
- "version": "1.0.6",
+ "version": "1.0.7",
"description": "YANG model-driven CORD",
"author": "Peter K. Lee <peter@corenova.com>",
"license": "Apache-2.0",
@@ -32,8 +32,8 @@
"minimist": "^1.2.0",
"node-uuid": "^1.4.7",
"superagent": "^2.0.0",
- "yang-express": "^0.2.7",
- "yang-js": "^0.15.3"
+ "yang-express": "^0.2.8",
+ "yang-js": "^0.15.4"
},
"optionalDependencies": {
"corenova": "^1.0.0"
diff --git a/src/api/README.md b/src/api/README.md
index 43de746..1c7fc92 100644
--- a/src/api/README.md
+++ b/src/api/README.md
@@ -404,8 +404,8 @@
`mandatory` *id* and *service-specific-id* properties, it will
generate an error and reject the request.
-Also, if you tried to PUT using data values that does not conform to
-the underlying YANG schema for that data element, it will generate an
+Also, if you tried to PUT using data values that do not conform to the
+underlying YANG schema for that data element, it will generate an
error and reject the requst.
Invalid Request:
diff --git a/src/api/server.coffee b/src/api/server.coffee
index c315445..0d68b7d 100644
--- a/src/api/server.coffee
+++ b/src/api/server.coffee
@@ -10,13 +10,18 @@
yang = require('yang-js')
argv = require('minimist')(process.argv.slice(2))
-require('yang-express').run {
-
- port: argv.port || 5050
+app = require('yang-express') {
models: [
yang.require 'cord-core'
yang.require 'xos-core'
]
- data: require '../../sample-data.json'
+ controllers: [
+ 'restjson'
+ 'socket-io'
+ ]
+ views: [
+ ]
+ data: require '../../sample-data.json'
}
+app.run argv.port || 5050