bigbluebutton-Github/labs/meteor-client/app/server/server.coffee
Anton Georgiev ca605e2e8c cleaning up
2014-10-30 23:16:47 +00:00

34 lines
1007 B
CoffeeScript
Executable File

###
Meteor.startup(function () {
// Add seed data if first time server starting
CreateSeedData();
// Publish data collections
PublishCollections();
// Set collection permissions
SetCollectionPermissions();
});
###
Meteor.methods
# If we can change this to a format where we know what to send the user that'd
# be much, much better than the user passing in the first part of their
# credentials and us looking up and suplying them with the second part.
# It'd be much more secure.
getMyInfo: (uId) ->
u = Meteor.Users.findOne("userId": uId)
if u?
console.log "__server::getMyInfo " + u.userId + " DBID:" + u._id + " name:" + u.user.name
return {userId: u.userId, DBID: u._id, name: u.user.name}
Meteor.startup ->
console.log "server start"
#remove all data
clearCollections()
# create create a PubSub connection, start listening
Meteor.redisPubSub = new Meteor.RedisPubSub(->
console.log "created pubsub")