From f27d91a803febe4362ca5e2e75720a39bd8ba535 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 17 Apr 2015 12:59:48 -0400 Subject: [PATCH] prepare for production deployment --- Gruntfile.js | 3 +-- client/app/compare/create/create.jade | 2 +- client/app/compare/show/show.jade | 2 +- client/components/navbar/navbar.controller.js | 12 +----------- server/components/wdiff/index.js | 9 +++++---- server/config/environment/development.js | 2 +- server/config/environment/production.js | 4 ++-- 7 files changed, 12 insertions(+), 22 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 0c38c99..192d19b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -591,7 +591,7 @@ module.exports = function (grunt) { grunt.registerTask('serve', function (target) { if (target === 'dist') { - return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'wait', 'open', 'express-keepalive']); + return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'wait', 'express-keepalive']); } if (target === 'debug') { @@ -617,7 +617,6 @@ module.exports = function (grunt) { 'autoprefixer', 'express:dev', 'wait', - 'open', 'watch' ]); }); diff --git a/client/app/compare/create/create.jade b/client/app/compare/create/create.jade index 7ea5b80..9d612e8 100644 --- a/client/app/compare/create/create.jade +++ b/client/app/compare/create/create.jade @@ -1,6 +1,6 @@ // nav(ng-include='"components/navbar/navbar.html"') -nav(ng-include='"components/elements/header.html"', onload='title = "wdiff markdown"; ') +nav(ng-include='"components/elements/header.html"', onload='title = "dubdiff"; ') .container diff --git a/client/app/compare/show/show.jade b/client/app/compare/show/show.jade index 99adf11..4bfa2e5 100644 --- a/client/app/compare/show/show.jade +++ b/client/app/compare/show/show.jade @@ -1,6 +1,6 @@ // nav(ng-include='"components/navbar/navbar.html"') -nav(ng-include='"components/elements/header.html"', onload='title = "wdiff markdown"; subtitle ="results"') +nav(ng-include='"components/elements/header.html"', onload='title = "dubdiff"; subtitle ="results"') .container .row diff --git a/client/components/navbar/navbar.controller.js b/client/components/navbar/navbar.controller.js index 87f3782..74d8cf5 100644 --- a/client/components/navbar/navbar.controller.js +++ b/client/components/navbar/navbar.controller.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('markdownFormatWdiffApp') - .controller('NavbarCtrl', function ($scope, $location , /*Auth*/) { + .controller('NavbarCtrl', function ($scope, $location) { $scope.menu = [{ 'title': 'Home', 'link': '/' @@ -9,16 +9,6 @@ angular.module('markdownFormatWdiffApp') $scope.isCollapsed = true; - /* - $scope.isLoggedIn = Auth.isLoggedIn; - $scope.isAdmin = Auth.isAdmin; - $scope.getCurrentUser = Auth.getCurrentUser; - - $scope.logout = function() { - Auth.logout(); - $location.path('/login'); - }; - */ $scope.isActive = function(route) { return route === $location.path(); diff --git a/server/components/wdiff/index.js b/server/components/wdiff/index.js index b4a5b7e..2dc633b 100644 --- a/server/components/wdiff/index.js +++ b/server/components/wdiff/index.js @@ -35,7 +35,7 @@ module.exports = function(a, b, asMarkdown, callback) { if (err) return callback(err); - //write the string to the file + //write the string to the file fs.write(fileb.fd, b); //close the file @@ -45,11 +45,12 @@ module.exports = function(a, b, asMarkdown, callback) { var cmd = "./bin/wdiff " + filea.path + " " +fileb.path; exec(cmd, function(err, stdout) { - +//console.log(cmd); +//console.log(err); +//console.log(stdout); if (err && err.code!=1 && err.code!=0) { return callback(err); } - //if no difference was found by wdiff, err.code will be 0 var wdiffSame; wdiffSame = (err && err.code == 0) ? true:false; @@ -246,4 +247,4 @@ function rewriteWdiffMarkdown(source) { }); return output; -} \ No newline at end of file +} diff --git a/server/config/environment/development.js b/server/config/environment/development.js index 7fc9b59..f4b1194 100644 --- a/server/config/environment/development.js +++ b/server/config/environment/development.js @@ -5,7 +5,7 @@ module.exports = { // MongoDB connection options mongo: { - uri: 'mongodb://localhost/markdownformatwdiff-dev' + uri: 'mongodb://mongodb/markdownformatwdiff-dev' }, seedDB: false diff --git a/server/config/environment/production.js b/server/config/environment/production.js index 3014393..dbe3b3f 100644 --- a/server/config/environment/production.js +++ b/server/config/environment/production.js @@ -18,6 +18,6 @@ module.exports = { uri: process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || process.env.OPENSHIFT_MONGODB_DB_URL+process.env.OPENSHIFT_APP_NAME || - 'mongodb://localhost/markdownformatwdiff' + 'mongodb://mongodb/markdownformatwdiff' } -}; \ No newline at end of file +};