Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions nodetp3/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,24 @@ passport = require('passport'),
LocalStrategy = require('passport-local').Strategy;

//MySQL
/*

var sqlInfo = {
host: 'localhost',
user: 'root',
password: 'exalt',
database: 'sa'
}
/*

*/
var sqlInfo = {
host: 'ap01-user01.c0ye1hvnkw6z.ap-southeast-1.rds.amazonaws.com',
user: 'uHJnIOAz4pfz8',
password: 'p1ER20bCzfHjp',
database: 'd14a406252e744680aca10c5e2ca8026c',
port:3306
}
*/

/*
if(process.env.VCAP_SERVICES){
var menv = JSON.parse(process.env.VCAP_SERVICES);
var mysql = menv['mysql-5.1'][0]['credentials'];

var sqlInfo = {
host: 'ap01-user01.c0ye1hvnkw6z.ap-southeast-1.rds.amazonaws.com',
user: 'uHJnIOAz4pfz8',
password: 'p1ER20bCzfHjp',
database: 'd14a406252e744680aca10c5e2ca8026c',
port:3306
}


}else{

var sqlInfo = {
host: 'localhost',
user: 'root',
password: 'exalt',
database: 'sa'
}

}
*/



Expand Down
48 changes: 14 additions & 34 deletions nodetp3/app.js~
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
*
* prabintp@aol.com
* last updated oct 4 2013
* last updated oct 24 2013
*/
//Module dependencies
var express = require('express'),
Expand All @@ -16,48 +16,24 @@ passport = require('passport'),
LocalStrategy = require('passport-local').Strategy;

//MySQL
/*

var sqlInfo = {
host: 'localhost',
user: 'root',
password: 'exalt',
password: '',
database: 'sa'
}
/*

*/
var sqlInfo = {
host: 'ap01-user01.c0ye1hvnkw6z.ap-southeast-1.rds.amazonaws.com',
user: 'uHJnIOAz4pfz8',
password: 'p1ER20bCzfHjp',
database: 'd14a406252e744680aca10c5e2ca8026c',
port:3306
}
*/

/*
if(process.env.VCAP_SERVICES){
var menv = JSON.parse(process.env.VCAP_SERVICES);
var mysql = menv['mysql-5.1'][0]['credentials'];

var sqlInfo = {
host: 'ap01-user01.c0ye1hvnkw6z.ap-southeast-1.rds.amazonaws.com',
user: 'uHJnIOAz4pfz8',
password: 'p1ER20bCzfHjp',
database: 'd14a406252e744680aca10c5e2ca8026c',
port:3306
}


}else{

var sqlInfo = {
host: 'localhost',
user: 'root',
password: 'exalt',
database: 'sa'
}

}
*/



Expand Down Expand Up @@ -164,8 +140,12 @@ app.get('/logout', function(req, res){
res.redirect('/home');
});

//get sites
//sites
app.get('/sites',routes.sites);
app.get('/sites/new',routes.new_sites);
app.get('/sites/get_sites',routes.get_sites);


app.get('/partials/:name', routes.partials);
// JSON API
app.get('/api/name', api.name);
Expand All @@ -186,18 +166,18 @@ app.post('/signup_submit',routes.signup_submit);
app.get('/log',routes.log);
//to project dashboard
app.get('/popular',routes.popular);
// redirect all others to the index (HTML5 history)
app.get('*', routes.index);

/**
* ajax calls starts
*/
//get todays top content json ajax
app.get('/dash/today_top_content',routes.topContent);

app.post('/ischeck/email',routes.check_isemail);
/**
* ajax calls ends
*/

// redirect all others to the index (HTML5 history)
app.get('*', routes.index);
/**
* routes end---------------------------------------------------------------------
*/
Expand Down