- Needs mongodb to run locally
- e.g.
docker run -p 27017:27017 --name mongo_instance_001 -d mongo:3.2 --smallfiles
- e.g.
- Needs env vars set to start and connect to mongo (mimicing a SaaS MBaaS)
- e.g.
FH_SERVICE_APP_PUBLIC=true FH_MONGODB_CONN_URL=localhost:27017 npm start
- e.g.
- Uses Patternfly http://www.patternfly.org/#_
- less in public/css, auto recompiles using less-middleware mounted as a route
- static content under public/
- browserified js, served via
app-built.js
- requires re-running
grunt browserify
to rebuild
- requires re-running
- uses handlebars templates in views/templates (html files)
- uses bootstrap js
- uses backbone for models, collections & views https://github.com/feedhenry-templates/fh-api-mapper/tree/master/public/js
- Models
- Collections
- Views
base.view.js
, which others extend- Request Default View (and request.html templates) https://github.com/feedhenry-templates/fh-api-mapper/blob/master/public/js/request.view.js
- Requests (default view) (and requests.html template) https://github.com/feedhenry-templates/fh-api-mapper/blob/master/public/js/requests.view.js
- Mapping (and mapping.html templates) https://github.com/feedhenry-templates/fh-api-mapper/blob/master/public/js/mapping.view.js
- Unit Tests for models & routes, run with
npm test
- main api mapper routers in
lib/api.js
- uses mongoose for requests and mappings models in lib/models/
- Mappings are dynamically mounted as routes in
lib/api.js
via populateSingleRoute & populateAllRoutes functions- Whenever a Request or Mapping changes, routes are updated
- https://github.com/feedhenry-templates/fh-api-mapper/blob/master/lib/api.js#L33-L79