codigami / hapi-starter-kit Goto Github PK
View Code? Open in Web Editor NEWHapi.js based REST boilerplate which uses latest ES7/ES8 features (async/await) with code coverage and follows best pratices
License: MIT License
Hapi.js based REST boilerplate which uses latest ES7/ES8 features (async/await) with code coverage and follows best pratices
License: MIT License
Hi, do you have an updated version for Hapi 17.1.1 ?
Hi,
I am trying to figure out the best way to add rethinkdb to this boiler plate. I am using hapi-rethinkdb which binds rethinkdb
and connection
to the server context in a request per this documentation.
https://github.com/ghostbar/hapi-rethinkdb#use-plugin
But in this boilerplate this context is not available in the handlers. So how do I setup the handlers on this starter kit so that this.rethinkdb
is available in the handler?
I am having to instead use var r = request.server.plugins['hapi-rethinkdb'].rethinkdb
to get a connection to the rethink db in every time in each handler.
thanks,
First, thank you for hapi-starter-kit. I have tried at least half a dozen different npm packages that all claim they create your swagger for you but they all came up short of that promise until I found hapi-starter-kit. This is the only true, out of the box, node/swagger solution I've found so thank you again.
One thing I did in my hapi-starter after I got it up and running, was to add support for import/export using esm. It was pretty much seamless. I moved the contents of the root index.js into a new file called main.js and then changed index.js to this:
// eslint-disable-next-line no-global-assign
require = require('esm')(module)
module.exports = require('./main.js')
And that's all there was to it. Just thought I'd offer it up as a suggestion since hapi-starter-kit is ES8/ES2017 friendly.
Hi,
Can you please add functionality to log request body in the console log, or somewhere developer can fetch?
When I tried 'yarn test' first time, I got error:
$ NODE_ENV=test istanbul --include-all-sources cover _mocha -- -u bdd $(find test -name '*.js') && istanbul check-coverage && echo All tests passed �
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
I then copied the 'test' script and create a test:win script:
"test:win": "SET NODE_ENV=test istanbul --include-all-sources cover _mocha -- -u bdd $(find test -name '*.js') && istanbul check-coverage && echo All tests passed 👍",
I ran 'yarn test:win', I got the istanbul's error:
yarn test:win
yarn run v1.2.1
$ SET NODE_ENV=test istanbul --include-all-sources cover _mocha -- -u bdd $(find test -name '*.js') && istanbul check-coverage && echo All tests passed �
ERROR: No coverage files found.
Try "istanbul help" for usage
Do I need to manually create a coverage file or am I missing any dependencies?
Thanks
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.