mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-15 00:12:17 +00:00
Setup queries.coffee
This commit is contained in:
parent
9437da73d1
commit
b0a95b69d2
4 changed files with 13 additions and 1 deletions
|
|
@ -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)
|
||||
Loading…
Reference in a new issue