Code package for hapi.js in Action by Matt Harrison (Manning 2015 ISBN: 978-1-63343-021-1)
- All code is organised by chapter and section numbering
- Additional resources such as DB schema, sample data etc is placed in the chapter's top level directory
Code package for hapi.js in Action by Matt Harrison (Manning Publications)
Code package for hapi.js in Action by Matt Harrison (Manning 2015 ISBN: 978-1-63343-021-1)
Hey Matt,
I'm stoked to watch you're latest videos for Hapi! I was wondering if you intend to update this project to Hapi 17, or if you would have any interest in doing so? I am new to Hapi, so I was thinking it might be an interesting way to learn Hapi and contribute back with a PR to update some sections.
this is code's url:
https://github.com/mtharrison/hapi.js-in-action/blob/master/CH04%20-%20Routes%20and%20Handlers%20in%20Depth/4.4/4.4.4/index.js
this code:
console.log('Decrypted message: ' + request.pre.decryptMessage);
Why is his value 'Ink is dry'?
Here is the dbConneciton:
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....
Hi, firstly I'd like to thank you for writing a great book. I purchased it yesterday and already found it very helpful.
One question I have concerns the way you validate whether /api/get/{id}
returns an actual result from the database:
if (typeof result !== 'undefined') {
return reply(result);
}
Why not take advantage of the type coercion and simply:
if (result) {
return reply(result);
}
Does typeof
cover some exceptional cases I do not foresee?
Thank you very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.