From 1c6b19178e9c085fd906ca94a1d43470911ea470 Mon Sep 17 00:00:00 2001 From: briandavidjoyner Date: Sat, 4 Nov 2017 22:32:01 -0400 Subject: [PATCH] Update With Angular --- public/scripts/main_controller.js | 3 +++ public/scripts/module.js | 1 + public/views/pages/index.html | 7 ++++++- server.js | 6 +++--- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 public/scripts/main_controller.js create mode 100644 public/scripts/module.js diff --git a/public/scripts/main_controller.js b/public/scripts/main_controller.js new file mode 100644 index 0000000..105af7d --- /dev/null +++ b/public/scripts/main_controller.js @@ -0,0 +1,3 @@ + app.controller('main_controller', ['$scope','brandInfo','brandData','itemData','sizeData','$route','$window', 'title', + function($scope){} + ]); \ No newline at end of file diff --git a/public/scripts/module.js b/public/scripts/module.js new file mode 100644 index 0000000..8edf4fd --- /dev/null +++ b/public/scripts/module.js @@ -0,0 +1 @@ +var app = angular.module('diapers_app',[]); \ No newline at end of file diff --git a/public/views/pages/index.html b/public/views/pages/index.html index 9aa55e5..3d9ef1b 100644 --- a/public/views/pages/index.html +++ b/public/views/pages/index.html @@ -1,5 +1,10 @@ - + + + + + + diff --git a/server.js b/server.js index 7a2b036..5693536 100644 --- a/server.js +++ b/server.js @@ -12,14 +12,14 @@ var port = process.env.PORT || process.env.OPENSHIFT_NODEJS_PORT || 8080; //app.use(morgan('combined')); //External Routing -app.get('/', function (req, res) { +app.use('/public', express.static(__dirname + '/public')); + +app.get('*', function (req, res) { console.log('works as expected'); res.sendFile(__dirname + '/public/views/pages/index.html'); //res.send('Hello World Again!'); }); -app.use('/public', express.static(__dirname + '/public')); - //app Initialize app.listen(port, ip); //console.log('live on ip: ' + ip + ':' + port);