Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some config changes.

  • Loading branch information...
commit 3e200dc7e5ca96a2f8cd8b2112e4c1d5b855276a 1 parent f8bafb6
@eagereyes authored
View
2  .gitignore
@@ -1,5 +1,5 @@
.DS_Store
/data
-db-conf.js
+conf.js
header.acorn
*.log
View
8 app.js
@@ -7,12 +7,12 @@ var express = require('express')
, mysql = require('mysql')
, user = require('./user.js')
, run = require('./run.js')
- , dbConf = require('./db-conf.js').conf
+ , conf = require('./conf.js')
, routes = require('./routes.js');
var MemcachedStore = require('connect-memcached')(express);
-var dbClient = mysql.createClient(dbConf);
+var dbClient = mysql.createClient(conf.dbConf);
var app = module.exports = express.createServer();
@@ -43,7 +43,9 @@ app.configure('production', function(){
// Routes
-app.get('/', routes.index);
+app.get('/', function(req, res) {
+ routes.index(req, res, conf.nikeClientID);
+});
app.get('/nike-login', function(req, res) {
req.session.userID = user.login(dbClient, req.query.nuid, req.query.oauth_token, req.query.access_token);
View
7 conf-template.js
@@ -0,0 +1,7 @@
+exports.conf = {
+ user: '<username>',
+ password: '<password>',
+ database: '<db-name>'
+}
+
+exports.nikeClientID = '<Nike+ Client ID>';
View
7 db-conf-template.js
@@ -1,7 +0,0 @@
-exports.conf = {
-
- user: '<username>',
- password: '<password>',
- database: '<db-name>'
-
-}
View
4 routes.js
@@ -3,11 +3,11 @@
* GET home page.
*/
-exports.index = function(req, res){
+exports.index = function(req, res, nikeClientID){
if (req.session.userID != undefined) {
res.render('redirect', { title: 'Redirecting ...', redirectURL: '/export'})
} else {
- res.render('index', { title: 'eagerfeet'})
+ res.render('index', { title: 'eagerfeet', nikeClientID: nikeClientID})
}
};
View
8 views/index.jade
@@ -16,7 +16,7 @@ block append main
| follow me on twitter
| .
div.nike-login
- script(id="nikeoauth",
- data-clientid="54dff1e61f4ac4a56c98ad57ef3ed377",
- data-userid="nobody",
- src="https://www.nike.com/profile/assets/oauth/js/nikeoauth.min.js")
+ script(id='nikeoauth',
+ data-clientid='#{nikeClientID}',
+ data-userid='nobody',
+ src='https://www.nike.com/profile/assets/oauth/js/nikeoauth.min.js')
Please sign in to comment.
Something went wrong with that request. Please try again.