-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from molekilla/feature_08_2016_bump_deps
Feature 08 2016 bump deps
- Loading branch information
Showing
40 changed files
with
269 additions
and
212 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Rutha Stack - Taming HapiJS and AngularJS # | ||
**Ru** le | ||
**T** hem | ||
**H** apiJS | ||
**A** ngularJS | ||
|
||
Pure pragmatic NodeJS stack | ||
|
||
### Features ### | ||
|
||
After years of dealing with Sinatra (Ruby) and Backbone, and a brief ExpressJS side project, I figure out that: | ||
|
||
* **AngularJS** is a faster approach for most use cases where you don't need rocket scientists or rock stars in your roster (team) to learn all the nuances of working with Backbone (e.g. child views). | ||
* Corporate support is a must for open source projects, giving my 2 cents to **HapiJS** because it has all features that you need, is stable, and most important, releases are frequent and contributors are a lot (and they don't jump ship to Golang) | ||
* **Jasmine 2.0 (Server side)**: Both Angular Protractor and Facebook Jest are based on Jasmine. Using Mocha/Chai combo just adds to your learning curve. Jasmine 2.0 has been given more updates than ever before. Is a must have. | ||
* **Grunt JIT**: Is JIT for Grunt. No more waits. | ||
* **BrowserSync**: Choose this because it was painless to configure | ||
* **Underscore for frontend server side templates**: To avoid issues with AngularJS. | ||
* [Grunt ngAnnotate](https://github.com/mzgol/grunt-ng-annotate) | ||
* [Grunt Angular Templates](https://github.com/ericclemmons/grunt-angular-templates) | ||
* [Grunt Wiredep](https://github.com/stephenplusplus/grunt-wiredep) | ||
* **Rule Them All with a single environment**: Both development and production environment are the same. We concat, annotate, mix some ingredients and offer you the same production environment for development. | ||
* **Specs and Functional Tests (Frontend)**: Based partially on [year of moo](http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html) | ||
* **Frontend** [Todd Motto's](http://toddmotto.com/opinionated-angular-js-styleguide-for-teams/) AngularJS guideline: I also based some ideas on [PackPub's Angular Book](http://www.packtpub.com/angularjs-web-application-development/book?tag=dp/masteringwebwithangularjs-abr1/0913) | ||
* **Visionmedia/debug** [module](https://github.com/visionmedia/debug) by default | ||
|
||
### Grunt Help (Service) ### | ||
|
||
* `npm start`: Serves API service | ||
* `npm test`: Runs Jasmine NPM specs | ||
* `npm run nsp`: Verifies modules that contains security issues | ||
* `grunt migrate:create [--name]`: Creates a migration task. Args: --name: migration name (optional) | ||
* `grunt migrate:up [--revision]`: Migrates up. Args: --revision: revision name (optional) | ||
* `grunt migrate:down [--revision]`: Migrates down. Args: --revision: revision name (optional) | ||
|
||
|
||
|
||
### Nginx routes (Optional) ### | ||
|
||
``` | ||
server { | ||
# simple reverse-proxy for Rutha (Very useful!) | ||
listen 80; | ||
server_name localhost; | ||
access_log dev.log; | ||
#error_page http://here; | ||
location /api { | ||
proxy_pass http://127.0.0.1:3002; | ||
proxy_redirect default; | ||
proxy_set_header Host $host; | ||
} | ||
location / { | ||
proxy_pass http://127.0.0.1:3005; | ||
proxy_redirect default; | ||
proxy_set_header Host $host; | ||
} | ||
} | ||
``` | ||
|
||
### Maintainers, notes ### | ||
Maintain by Rogelio Morrell C. | ||
Pull Request are welcome but I might not turn around those quickly. | ||
|
||
### Disclaimer ### | ||
Feel free to fork. |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
var Hapi = require('hapi'); | ||
var Boom = require('boom'); | ||
var debug = require('debug')('api:main'); | ||
var RuthaUtils = require('rutha-utils'); | ||
var MongooseHandler = require('rutha-utils/mongoose'); | ||
var Mongoose = require('mongoose'); | ||
|
||
var config = RuthaUtils.createConfig({ | ||
const Hapi = require('hapi'); | ||
const Boom = require('boom'); | ||
const debug = require('debug')('api:main'); | ||
const RuthaUtils = require('rutha-utils'); | ||
const MongooseHandler = require('rutha-utils/mongoose'); | ||
const Mongoose = require('mongoose'); | ||
|
||
const config = RuthaUtils.createConfig({ | ||
path: { | ||
config: __dirname + '/../../config' | ||
} | ||
}).load(); | ||
|
||
var logger = RuthaUtils.createLogger({ | ||
const logger = RuthaUtils.createLogger({ | ||
filename: config.get('logger:filename') | ||
}); | ||
|
||
var client = Mongoose.connect(config.get('mongodb:connectionString')); | ||
const client = Mongoose.connect(config.get('mongodb:connectionString')); | ||
MongooseHandler.bindEvents(client); | ||
MongooseHandler.bindModels({ | ||
mongoose: client, | ||
|
@@ -24,7 +24,7 @@ MongooseHandler.bindModels({ | |
|
||
|
||
// Create a server with a host and port | ||
var server = module.exports = new Hapi.Server(); | ||
const server = module.exports = new Hapi.Server(); | ||
server.connection({ | ||
host: config.get('apiServer:host'), | ||
port: config.get('apiServer:port') | ||
|
@@ -38,17 +38,22 @@ server.app = { | |
}; | ||
|
||
// add server methods to IoC mongoose models | ||
var controllers = [ | ||
const controllers = [ | ||
{ | ||
register: require('../controllers/users'), | ||
} | ||
]; | ||
|
||
var logOptions = { | ||
reporters: [{ | ||
reporter: require('good-console'), | ||
events: {hapi: '*', log: '*', response: '*', error: '*', 'request': '*' } | ||
}] | ||
const logOptions = { | ||
reporters: { | ||
consoleLog: [{ | ||
module: 'good-squeeze', | ||
name: 'Squeeze', | ||
args: [{hapi: '*', log: '*', response: '*', error: '*', 'request': '*' }] | ||
}, { | ||
module: 'good-console' | ||
}, 'stdout'], | ||
} | ||
}; | ||
|
||
var serverPlugins = [ | ||
|
@@ -69,22 +74,22 @@ var serverPlugins = [ | |
register: require('hapi-swagger'), | ||
options: | ||
{ | ||
basePath: 'http://localhost:' + config.get('apiServer:port'), | ||
apiVersion: '1.0', | ||
host: 'localhost:' + config.get('apiServer:port'), | ||
basePath: '/api', | ||
documentationPath: '/api_docs', | ||
endpoint: '/rest_docs', | ||
authorizations: { | ||
token: { | ||
type: "apiKey", | ||
passAs: "header", | ||
keyname: "authentication" | ||
} | ||
}, | ||
// endpoint: '/rest_docs', | ||
// auth: { | ||
// token: { | ||
// type: "apiKey", | ||
// passAs: "header", | ||
// keyname: "authentication" | ||
// } | ||
// }, | ||
info: { | ||
title: 'Rutha REST API Documentation', | ||
version: '1.0', | ||
description: 'REST API Docs.', | ||
contact: '[email protected]', | ||
license: 'MIT' | ||
license: { name: 'MIT' } | ||
} | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.