aboutsummaryrefslogtreecommitdiffstats
path: root/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-08-08 11:19:11 -0700
committerAdam Soltys <[email protected]>2014-08-08 11:33:24 -0700
commit6d5c3a56067b96bb5d97cca4a80bacbf78395b2c (patch)
treef7b4b8d7aed2fec54b16f7294cfaff2867e33557 /app.js
parent163f681ff6d4d4eb2b111a6cdfa0e0133f6840ad (diff)
downloadcoinos-server-6d5c3a56067b96bb5d97cca4a80bacbf78395b2c.tar.gz
coinos-server-6d5c3a56067b96bb5d97cca4a80bacbf78395b2c.zip
Move session secret into unversioned config file
Diffstat (limited to 'app.js')
-rw-r--r--app.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/app.js b/app.js
index bd282be5..1e8cb145 100644
--- a/app.js
+++ b/app.js
@@ -1,5 +1,5 @@
(function() {
- var RedisStore, app, authorize, bodyParser, calculator, cookieParser, express, passport, path, session, sessionStore, sessions, transactions, users;
+ var RedisStore, app, authorize, bodyParser, calculator, config, cookieParser, express, passport, path, session, sessionStore, sessions, transactions, users;
express = require('express');
@@ -11,6 +11,8 @@
passport = require('./passport');
+ config = require('./config');
+
calculator = require("./routes/calculator");
sessions = require("./routes/sessions")(passport);
@@ -49,12 +51,12 @@
type: 'application/vnd.api+json'
}));
- app.use(cookieParser('weareallmadeofstars'));
+ app.use(cookieParser(config.secret));
app.use(session({
resave: true,
saveUninitialized: true,
- secret: 'weareallmadeofstars',
+ secret: config.secret,
store: sessionStore,
cookie: {
maxAge: 1209600000
@@ -102,10 +104,10 @@
app.get('/:user/report', authorize, transactions.index);
- app.get('/:user', authorize, users.show);
-
app.get('/:user.json', authorize, users.json);
+ app.get('/:user', authorize, users.show);
+
app.use(require('connect-assets')({
src: 'public',
servePath: '/'