You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varfeathers=require('feathers');varhooks=require('feathers-hooks');varknex=require('feathers-knex');// Initialize a MongoDB service with the users collection on a local MongoDB instancevarapp=feathers().configure(hooks()).use('/users',knex('users',{dialect: 'sqlite3',connection: {filename: './data.db'}}));app.lookup('users').before({create: function(hook,next){hook.data.createdAt=newDate();next();},update: function(hook,next){hook.data.updatedAt=newDate();next();}});app.listen(8080);
Output:
TypeError: app.lookup is not a function
at Object.<anonymous> (/Users/dan.kaplun/euclidsnap/server.js:15:5)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:457:10)
at startup (node.js:136:18)
at node.js:972:3
The text was updated successfully, but these errors were encountered:
It's app.service not app.lookup, I fixed it in the readme. Sorry about that, we're still in the process reviewing all the adapter docs and making sure everything works as described (.lookup was the pre Feathers 1.0 name for .service).
Output:
The text was updated successfully, but these errors were encountered: