If you haven't installed brew
on your machine yet - do it fucking
NOW
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- MongoDB
brew update
Install with or without SSL/TLS support:
brew install mongodb
or
brew install mongodb --with-openssl
- node && npm
brew install node
It should install npm
as well.
- install node_modules
From the
hapi-bolerplate
directory run:
npm install
Things might change
The basic idea is to keep every resource
separated from the rest.
The structure is quite easy:
-
config
folder - put your config related info there ** in the boilerplate you'll find themanifest.json
inside - it's used byGlue
to provision the server -
test
folder, contains of the tests andfixtures
-
lib
folder - folder for your routes -
modules
- holds all the resources -
beers
- represents a folder with everything related to beers. It consists of following folders/files: -
index.js
- describes which operations can be performed onbeers
resource -
package.json
- describes thebeers
plugin -name
andversion
-
handlers
folder - keeps all handler files e.g.createBeer.js
/updateBeer.js
/getBeers.js
/getBeer.js
/deleteBeer.js
etc. -
schemas
folder - holdsJoi
validation schemas for any operation you need e.g.beer.js
/createBeer.js
etc. -
utils
- any additional stuff yourbeers
need e.g.calculateAlc.js
etc.