mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Setup queries.coffee
This commit is contained in:
@@ -39,6 +39,8 @@ store = derby.createStore({
|
||||
listen: server
|
||||
});
|
||||
|
||||
require('./queries')(store);
|
||||
|
||||
ONE_YEAR = 1000 * 60 * 60 * 24 * 365;
|
||||
|
||||
root = path.dirname(path.dirname(__dirname));
|
||||
|
||||
7
lib/server/queries.js
Normal file
7
lib/server/queries.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
|
||||
module.exports = function(store) {
|
||||
return store.query.expose('users', 'withId', function(id) {
|
||||
return this.byId(id);
|
||||
});
|
||||
};
|
||||
@@ -24,7 +24,7 @@ derby.use(require 'racer-db-mongo')
|
||||
store = derby.createStore
|
||||
db: {type: 'Mongo', uri: process.env.NODE_DB_URI}
|
||||
listen: server
|
||||
#require('./queries')(store)
|
||||
require('./queries')(store)
|
||||
|
||||
ONE_YEAR = 1000 * 60 * 60 * 24 * 365
|
||||
root = path.dirname path.dirname __dirname
|
||||
|
||||
3
src/server/queries.coffee
Normal file
3
src/server/queries.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = (store) ->
|
||||
store.query.expose 'users', 'withId', (id) ->
|
||||
@byId(id)
|
||||
Reference in New Issue
Block a user