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
const Sqlite3 = require('sqlite3');
const db = new Sqlite3.Database('./dindin.sqlite');
I had use bind the db with server.bind({ db: dbConnection }) but i dont know why i cannot access the this.db in handlers. According to book [Hapi Js in Action] and server.bind it should be working. I had to use server.app.db = dbConnection and every handler i had to do something like const db = request.server.app.db and works fine.. is there issue with server.bind in hapi js version 13.4.0 and I m loving ur book....
The text was updated successfully, but these errors were encountered:
i got it working with server.app.db = dbConnection but not with server.bind({db: dbConnection }).. May be there is issue with my code.. I will compare it.
Here is the dbConneciton:
I had use bind the db with
server.bind({ db: dbConnection })
but i dont know why i cannot access thethis.db
in handlers. According to book[Hapi Js in Action]
and server.bind it should be working. I had to useserver.app.db = dbConnection
and every handler i had to do something likeconst db = request.server.app.db
and works fine.. is there issue with server.bind in hapi js version 13.4.0 and I m loving ur book....The text was updated successfully, but these errors were encountered: