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
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
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
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 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); |
NewerOlder