-
Notifications
You must be signed in to change notification settings - Fork 17
Conversation
|
||
This template uses [Grunt](http://gruntjs.com/), the Javascript Task Runner. To use Grunt with this Template App, do the following: | ||
|
||
* Install grunt: ```npm install -g grunt-cli``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend adding grunt
and grunt-cli
to package.json
. Better yet, maybe don't use grunt and instead use just npm scripts like so:
"start": "NODE_PATH=. nodemon application.js"
"lint": "eslint lib/*.js lib/**/*.js "
That's what we're doing typically. Grunt seems to confuse people new to node and new to the platform and the value its adds is pretty questionable IMHO.
Even if we really feel grunt helps then still worth adding the start/serve script that calls grunt serve
since it will automatically use a grunt found in node_modules/.bin/grunt
😄
|
||
# Tasks | ||
|
||
The following are a short overview of the Grunt tasks available for this App. You can get a full list of tasks from Grunt with ```grunt --help```. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run
will do similar 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lifecycle scripts included in node-custom-mailer:
test
npm run lint && npm run cover && nyc check-coverage --statements 95 --lines 95 --functions 95 --branches 95
available via `npm run-script`:
unit
NODE_PATH=. BLUEBIRD_DEBUG=true mocha lib/*.test.js -t 5000
lint
eslint $(find ./lib -name '*.js')
cover
nyc --reporter=lcov --produce-source-map=true npm run unit
pretty
prettier-eslint --write --prettier.single-quote --prettier.print-width=100 lib/*.js
precommit
lint-staged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,29 @@ | |||
var mongodb = require('mongodb'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wtrocki might be nice to plug @MikeyBurkman's mongo module here to make the code a little cleaner? https://github.com/MikeyBurkman/rhmap-mongodb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay promises! Though I should probably publish that to npm...
I will point out that you aren't handling the possible error when connecting to mongo, which is the most likely place for an error to occur. (My rhmap-mongodb automatically catches that, and even retries automatically, btw :) )
"time-grunt": "~0.3.1", | ||
"grunt-node-inspector": ">=0.2.0" | ||
}, | ||
"license": "mit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be SEE LICENSE in LICENSE
I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be APL 2.0 https://www.apache.org/licenses/LICENSE-2.0
"express": "~4.0.0", | ||
"fh-mbaas-api": "7.0.0-1", | ||
"fh-sync": "1.0.0", | ||
"mongodb": "^2.1.18", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fail on certain RHMAP instances. It needs to be ~2.1.18
since 2.2
has some issue with some URL formats.
👍 definitely useful to have this |
@evanshortiss Thanks for review. |
Closing in favor of simple example file without including any platform details etc. |
adding redis password
Sample application for sync.