diff --git a/demo-shell-ng2/browser-sync-config.js b/demo-shell-ng2/browser-sync-config.js deleted file mode 100644 index af6440b202..0000000000 --- a/demo-shell-ng2/browser-sync-config.js +++ /dev/null @@ -1,25 +0,0 @@ -var browserSync = require("browser-sync").create(); -var historyApiFallback = require('connect-history-api-fallback'); - -browserSync.init({ - - server: { - baseDir: './', - middleware: [ historyApiFallback() ] - }, - - files: [ - 'index.html', - 'app/**/*.{html,htm,css,js}', - 'dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-core/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-datatable/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-documentlist/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-login/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-search/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-upload/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-viewer/dist/**/*.{html,htm,css,js}', - 'node_modules/ng2-alfresco-webscript/dist/**/*.{html,htm,css,js}'], - -reloadDelay: 1000 -}); diff --git a/demo-shell-ng2/package.json b/demo-shell-ng2/package.json index 0fa4b6e32c..6e5456d8b9 100644 --- a/demo-shell-ng2/package.json +++ b/demo-shell-ng2/package.json @@ -9,7 +9,7 @@ "start": "npm run tslint && concurrently \"npm run tsc:w\" \"license-check\" \"npm run serve\" ", "tsc": "tsc", "tsc:w": "tsc -w", - "serve": "node browser-sync-config.js", + "serve": "wsrv -o -s -l -p 3000 -x ./server/versions.js", "typings": "typings install", "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json app/{,**/}**.ts", "licensecheck": "license-check" @@ -86,13 +86,12 @@ "ng2-alfresco-webscript": "file:../ng2-components/ng2-alfresco-webscript" }, "devDependencies": { - "browser-sync": "2.10.0", "concurrently": "2.0.0", - "connect-history-api-fallback": "1.2.0", "license-check": "1.1.5", "tslint": "3.8.1", "typescript": "1.8.10", - "typings": "1.0.4" + "typings": "1.0.4", + "wsrv": "0.1.4" }, "license-check-config": { "src": [ diff --git a/demo-shell-ng2/server/versions.js b/demo-shell-ng2/server/versions.js new file mode 100644 index 0000000000..478bc86fe0 --- /dev/null +++ b/demo-shell-ng2/server/versions.js @@ -0,0 +1,39 @@ +'use strict'; + +// wsrv extension that provides dynamic '/versions' route + +exports.register = function (server, options, next) { + + var packages = [ + 'ng2-activiti-form', + 'ng2-alfresco-core', + 'ng2-alfresco-datatable', + 'ng2-alfresco-documentlist', + 'ng2-alfresco-login', + 'ng2-alfresco-search', + 'ng2-alfresco-upload', + 'ng2-alfresco-viewer', + 'ng2-alfresco-webscript' + ]; + + server.route({ + method: 'GET', + path: '/versions', + handler: function (request, reply) { + + var result = {}; + packages.map(function (packageName) { + result[packageName] = require('./../node_modules/' + packageName + '/package.json').version + }); + + reply(result); + } + }); + + next(); +}; + +exports.register.attributes = { + name: 'ng2-module-versions', + version: '1.0.0' +}; diff --git a/demo-shell-ng2/wsrv-config.json b/demo-shell-ng2/wsrv-config.json new file mode 100644 index 0000000000..69fa7707ea --- /dev/null +++ b/demo-shell-ng2/wsrv-config.json @@ -0,0 +1,13 @@ +{ + "watch": [ + "node_modules/ng2-alfresco-core/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-datatable/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-documentlist/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-login/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-search/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-upload/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-viewer/dist/**/*.{html,css,js}", + "node_modules/ng2-alfresco-webscript/dist/**/*.{html,css,js}", + "node_modules/ng2-activiti-form/dist/**/*.{html,css,js}" + ] +}