This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var writeToCollection = function(collectionName, jsonObject){ | |
try{ | |
//the db name is hardcoded, | |
var collection = new mongo.Collection(db, collectionName); | |
collection.insert(jsonObject, {safe:true}, function(err, objects) { | |
if(err != null){ | |
sys.log("Could not write JSON in collection ->" + err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.findOrCreateFacebookUser = function(fbUserData, promise){ | |
User.findOne({_id:fbUserData.id}, function(err, user) { | |
if(err) { | |
console.log("Error in finding user for auth. Check Db"); | |
promise.fail(err); | |
return; | |
} | |
else if(user){ | |
console.log("User found "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require("express"), | |
app = express.createServer(); | |
app.use(express.static(__dirname + '/static')); | |
app.get('/', function(req, res){ | |
res.send('Hello World'); | |
}); | |
app.listen(process.env.C9_PORT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getParcourList = function(userId){ | |
GeneralReference.findOne({ id: userId}, function(err, result){ | |
if(err){ | |
console.log("error in save: " + err); | |
return "No Document found: " + err; | |
}else{ | |
//console.log(JSON.strinresult.parcours); | |
return result.parcours; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[node@workoutcell ~]$ node-service-deploy | |
Deploying node-service. | |
revision: master | |
timestamp: 2011-10-23T15-38-27.419110651 | |
Installing node module deps (from package.json). | |
npm WARN invalid config node-version="v0.4" | |
> mongoose@2.3.6 test /home/node/node-service/releases/2011-10-23T15-38-27.41911 0651/node_modules/mongoose | |
> make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; userconfig /home/node/.npmrc | |
link = true | |
prefix = "/home/node/local" | |
tmp = "/home/node/.tmp" | |
; node install prefix = /opt/nodejs/v0.4 | |
; node bin location = /opt/nodejs/v0.4/bin/node | |
; cwd = /home/node/node-service/releases/2011-10-23T15-38-27.419110651/node_modules/mongoose/node_modules/mongodb | |
; HOME = /home/node | |
; 'npm config ls -l' to show all defaults. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying node-service. | |
revision: master | |
timestamp: 2011-10-23T16-16-54.342441619 | |
Installing node module deps (from package.json). | |
npm WARN invalid config node-version="v0.4" | |
> express@2.4.7 test /home/node/node-service/releases/2011-10-23T16-16-54.342441619/node_modules/express | |
> make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "name": "test", | |
"version": "0.1.3", | |
"dependencies": | |
{ | |
"express": "2.4.7", | |
"everyauth": "0.2.23", | |
"mongoose": "2.3.6" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Counting objects: 10, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (6/6), done. | |
Writing objects: 100% (6/6), 685 bytes, done. | |
Total 6 (delta 4), reused 0 (delta 0) | |
remote: Deploying node-service. | |
remote: revision: 3b1dbf806500f56d5954010bcc559b02266c11bc | |
remote: timestamp: 2011-10-23T19-36-49.040696340 | |
remote: Installing node module deps (from package.json). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var saveEvent = function(eventObject, userId, ref, callback){ | |
var theEvent = new CalendarEvent(); | |
theEvent.title = eventObject.title; | |
theEvent.allDay = eventObject.allDay; | |
theEvent.start = eventObject.start; | |
theEvent.end = eventObject.end; | |
theEvent.url = "empty"; | |
theEvent.color = eventObject.color; |
OlderNewer