New resource generator for REST Apis
diff --git a/views/ngXosViews/sampleView/env/default.js b/views/ngXosViews/sampleView/env/default.js
index 5194914..2a5e8c0 100644
--- a/views/ngXosViews/sampleView/env/default.js
+++ b/views/ngXosViews/sampleView/env/default.js
@@ -8,6 +8,6 @@
module.exports = {
host: 'http://xos.dev:9999',
- xoscsrftoken: 'tfu7IRY4yS7gL1ofUH1sniQhuz7DTE5z',
- xossessionid: 'p3jagapanyfm7c1aqnkkahv85usgyaiu'
+ xoscsrftoken: 'NZ7lKKUcUUSYNeb7qpYKECL3MW3pKbSl',
+ xossessionid: 'kkhk28qo1dy6fc3v8lmzla6ry1dgm5xw'
};
diff --git a/views/ngXosViews/sampleView/gulp/server.js b/views/ngXosViews/sampleView/gulp/server.js
index 346bd79..13659c3 100644
--- a/views/ngXosViews/sampleView/gulp/server.js
+++ b/views/ngXosViews/sampleView/gulp/server.js
@@ -50,16 +50,14 @@
server: {
baseDir: options.src,
routes: {
- '/api': options.api,
'/xosHelpers/src': options.helpers
},
middleware: function(req, res, next){
- console.log(req.url);
if(
req.url.indexOf('/xos/') !== -1 ||
req.url.indexOf('/xoslib/') !== -1 ||
req.url.indexOf('/hpcapi/') !== -1 ||
- req.url.indexOf(`${conf.host}/api/`) !== -1
+ req.url.indexOf('/api/') !== -1
){
if(conf.xoscsrftoken && conf.xossessionid){
req.headers.cookie = `xoscsrftoken=${conf.xoscsrftoken}; xossessionid=${conf.xossessionid}`;
@@ -110,8 +108,7 @@
inject(
gulp.src([
options.tmp + '**/*.js',
- options.api + '*.js',
- options.helpers + '**/*.js'
+ options.helpers + '**/*.js' // todo add Babel here
])
.pipe(angularFilesort()),
{
diff --git a/views/ngXosViews/sampleView/src/index.html b/views/ngXosViews/sampleView/src/index.html
index 3b7337a..d24bb88 100644
--- a/views/ngXosViews/sampleView/src/index.html
+++ b/views/ngXosViews/sampleView/src/index.html
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="/css/main.css">
<!-- endinject -->
-<div ng-app="xos.sampleView" id="xosSampleView">
+<div ng-app="xos.sampleView" id="xosSampleView" class="container">
<div ui-view></div>
</div>
@@ -22,13 +22,17 @@
<!-- endbower --><!-- endjs -->
<!-- inject:js -->
<script src="/xosHelpers/src/xosHelpers.module.js"></script>
+<script src="/xosHelpers/src/services/rest/vSG.js"></script>
+<script src="/xosHelpers/src/services/rest/vOLT.js"></script>
+<script src="/xosHelpers/src/services/rest/Users.js"></script>
+<script src="/xosHelpers/src/services/rest/Truckroll.js"></script>
+<script src="/xosHelpers/src/services/rest/Subscribers.js"></script>
+<script src="/xosHelpers/src/services/rest/ONOS-Services.js"></script>
+<script src="/xosHelpers/src/services/rest/ONOS-Apps.js"></script>
<script src="/xosHelpers/src/ui_components/table/table.component.js"></script>
<script src="/xosHelpers/src/ui_components/ui-components.module.js"></script>
<script src="/xosHelpers/src/services/noHyperlinks.interceptor.js"></script>
<script src="/xosHelpers/src/services/csrfToken.interceptor.js"></script>
<script src="/xosHelpers/src/services/api.services.js"></script>
-<script src="/api/ng-xoslib.js"></script>
-<script src="/api/ng-xos.js"></script>
-<script src="/api/ng-hpcapi.js"></script>
<script src="/.tmp/main.js"></script>
<!-- endinject -->
diff --git a/views/ngXosViews/sampleView/src/js/main.js b/views/ngXosViews/sampleView/src/js/main.js
index 185f09b..896ab77 100644
--- a/views/ngXosViews/sampleView/src/js/main.js
+++ b/views/ngXosViews/sampleView/src/js/main.js
@@ -24,9 +24,9 @@
bindToController: true,
controllerAs: 'vm',
templateUrl: 'templates/users-list.tpl.html',
- controller: function($http){
+ controller: function(Users){
// retrieving user list
- $http.get('/api/core/users')
+ Users.query().$promise
.then((users) => {
this.users = users;
})