Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Added example application #1

Closed
wants to merge 1 commit into from
Closed

Added example application #1

wants to merge 1 commit into from

Conversation

wtrocki
Copy link
Member

@wtrocki wtrocki commented May 16, 2017

Sample application for sync.


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```
Copy link
Member

@evanshortiss evanshortiss May 16, 2017

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```.
Copy link
Member

@evanshortiss evanshortiss May 16, 2017

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 😉

Copy link
Member

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

Copy link
Member

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');
Copy link
Member

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

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",
Copy link
Member

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?

Copy link
Member

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",
Copy link
Member

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.

@evanshortiss
Copy link
Member

👍 definitely useful to have this

@wtrocki
Copy link
Member Author

wtrocki commented May 17, 2017

@evanshortiss Thanks for review.
Please note that this is my side project to decouple sync from fh-mbaas-api. It's not officially supported for the moment.

@wtrocki
Copy link
Member Author

wtrocki commented May 17, 2017

Closing in favor of simple example file without including any platform details etc.

@wtrocki wtrocki closed this May 17, 2017
chandu177 pushed a commit to chandu177/fh-sync that referenced this pull request Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants