Skip to content

Commit

Permalink
removed unused module
Browse files Browse the repository at this point in the history
  • Loading branch information
dshuffma-ibm committed Mar 22, 2017
1 parent bb69ed8 commit d8da581
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 30 deletions.
11 changes: 0 additions & 11 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ var compression = require('compression');
var serve_static = require('serve-static');
var path = require('path');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var http = require('http');
var app = express();
var url = require('url');
Expand Down Expand Up @@ -50,8 +49,6 @@ app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.engine('.html', require('jade').__express);
app.use(compression());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(cookieParser());
app.use(serve_static(path.join(__dirname, 'public')));
app.use(session({ secret: 'Somethignsomething1234!test', resave: true, saveUninitialized: true }));
Expand All @@ -71,18 +68,10 @@ logger.debug('cache busting hash js', process.env.cachebust_js, 'css', process.e
// Webserver Routing
// ============================================================================================================================
app.use(function (req, res, next) {
var keys;
logger.debug('------------------------------------------ incoming request ------------------------------------------');
logger.debug('New ' + req.method + ' request for', req.url);
req.bag = {}; //create object for my stuff
req.bag.session = req.session;

var url_parts = url.parse(req.url, true);
req.parameters = url_parts.query;
keys = Object.keys(req.parameters);
if (req.parameters && keys.length > 0) logger.debug({ parameters: req.parameters }); //print request parameters for debug
keys = Object.keys(req.body);
if (req.body && keys.length > 0) logger.debug({ body: req.body }); //print request body for debug
next();
});
app.use('/', require('./routes/site_router'));
Expand Down
2 changes: 1 addition & 1 deletion busters_css.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"public/css/singlecsshash":"48fd4b19a8b66d68fca43821119daec7"}
{"public/css/singlecsshash":"ee532e9fddf5e9501c85a97442d8a20d"}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"dependencies": {
"async": "0.9.*",
"body-parser": "1.15.*",
"compression": "1.6.*",
"cookie-parser": "1.4.*",
"cors": "2.8.*",
Expand Down
2 changes: 1 addition & 1 deletion public/css/main.min.css

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions routes/site_router.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var router = express.Router();
//anything in here gets passed to JADE template engine
function build_bag(req) {
return {
session: req.session.user, //pass session info
e: process.error, //send any setup errors
jshash: process.env.cachebust_js, //js cache busting hash (not important)
csshash: process.env.cachebust_css, //css cache busting hash (not important)
Expand All @@ -39,10 +38,6 @@ function get_credential_data() {
return ret;
}

function toTitleCase(str) {
return str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); });
}

// ============================================================================================================================
// Root
// ============================================================================================================================
Expand All @@ -58,7 +53,7 @@ router.route('/login').get(function (req, res) {
});

router.route('/login').post(function (req, res) {
req.session.user = { username: toTitleCase(req.body.username) };
req.session.user = { username: 'Admin' };
res.redirect('/home');
});

Expand Down
20 changes: 10 additions & 10 deletions views/template/nav.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
img(src="/imgs/logo.png")#logoIcon
span #{bag.marble_company}

if(bag && bag.session && bag.session.username)
#whoAmI
span.fa.fa-user#userIcon
span#userField #{bag.session.username}
span  
span.fa.fa-angle-down#carrot


#userSelect
#triangle
a(href="/logout").userLine Logout
#whoAmI
span.fa.fa-user#userIcon
span#userField Admin
span  
span.fa.fa-angle-down#carrot


#userSelect
#triangle
a(href="/logout").userLine Logout

0 comments on commit d8da581

Please sign in to comment.