Changed 'secrets' to 'env'

master
Keith Irwin 2017-04-12 14:51:32 -04:00
parent df8b0f0f7a
commit 42caa35d0f
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
2 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,7 @@ node.js application to display a map with user's location.
$ git clone https://github.com/Tracman-org/Server.git && (cd Server && exec npm install)
```
You will need to set up a configuration file at `config/secrets.js`. It should contain the following information:
You will need to set up a configuration file at `config/env.js`. It should contain the following information:
```javascript
'use strict';

View File

@ -10,7 +10,7 @@ const
nunjucks = require('nunjucks'),
passport = require('passport'),
flash = require('connect-flash'),
secret = require('./config/secrets.js'),
env = require('./config/env.js'),
User = require('./config/models/user.js'),
app = express(),
http = require('http').Server(app),
@ -19,7 +19,7 @@ const
/* SETUP */ {
/* Database */ mongoose.connect(secret.mongoSetup, {
/* Database */ mongoose.connect(env.mongoSetup, {
server:{socketOptions:{
keepAlive:1, connectTimeoutMS:30000 }},
replset:{socketOptions:{
@ -32,11 +32,11 @@ const
});
/* Session */ {
app.use(cookieParser(secret.cookie));
app.use(cookieParser(env.cookie));
// app.use(expressSession({
app.use(cookieSession({
cookie: {maxAge:60000},
secret: secret.session,
secret: env.session,
saveUninitialized: true,
resave: true
}));
@ -110,7 +110,7 @@ const
});
// Handlers
if (secret.env=='production') {
if (env.env=='production') {
app.use(function(err,req,res,next) {
if (res.headersSent) { return next(err); }
res.status(err.status||500);
@ -142,10 +142,10 @@ const
/* RUNTIME */ {
// Listen
http.listen(secret.port, function(){
http.listen(env.port, function(){
console.log(
'==========================================\n'+
'Listening at '+secret.url+
'Listening at '+env.url+
'\n=========================================='
);