Comparing version 0.0.3 to 0.0.4
@@ -0,1 +1,11 @@ | ||
<a name="0.0.4"></a> | ||
## [0.0.4](https://github.com/dylanfoster/parch/compare/0.0.3...v0.0.4) (2016-06-16) | ||
### Features | ||
* **application:** add default set of middlewares and merge with optional ([f3d3a2f](https://github.com/dylanfoster/parch/commit/f3d3a2f)) | ||
<a name="0.0.3"></a> | ||
@@ -2,0 +12,0 @@ ## [0.0.3](https://github.com/dylanfoster/parch/compare/0.0.2...v0.0.3) (2016-06-16) |
@@ -13,2 +13,6 @@ "use strict"; | ||
var _lodash = require("lodash"); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _loader = require("./loader"); | ||
@@ -26,2 +30,4 @@ | ||
var DEFAULT_MIDDLEWARES = [_restify2.default.gzipResponse(), _restify2.default.CORS(), _restify2.default.authorizationParser(), _restify2.default.bodyParser(), _restify2.default.fullResponse(), _restify2.default.queryParser()]; | ||
/** | ||
@@ -42,3 +48,3 @@ * TODO: | ||
// TODO: merge with defaults | ||
var middlewares = serverOptions.middlewares || []; | ||
var middlewares = _lodash2.default.union(DEFAULT_MIDDLEWARES, serverOptions.middlewares || []); | ||
var app = options.app || _restify2.default.createServer(serverOptions); | ||
@@ -56,2 +62,3 @@ var controllerLoader = new _loader2.default({ | ||
app.use(_restify2.default.acceptParser(app.acceptable)); | ||
middlewares.forEach(function (middlware) { | ||
@@ -58,0 +65,0 @@ app.use(middlware); |
{ | ||
"name": "parch", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Restify + Sequelize", | ||
@@ -9,2 +9,3 @@ "main": "index.js", | ||
"changelog": "conventional-changelog -s -p angular -i CHANGELOG.md", | ||
"prepare-release": "./scripts/prepare-release", | ||
"prepublish": "npm test && npm run build", | ||
@@ -47,4 +48,5 @@ "test": "mocha --recursive --compilers js:babel-register", | ||
"inflect": "^0.3.0", | ||
"lodash": "^4.13.1", | ||
"restify": "^4.1.0" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # parch | ||
**WIP: parch is very much still in beta so use at your own risk** | ||
** **WIP: parch is very much still in beta so use at your own risk** ** | ||
@@ -41,7 +41,7 @@ *If you'd like to contribute, take a look at the [roadmap](https://github.com/dylanfoster/parch/issues/1)* | ||
authentication: { | ||
secretKey: "ssshhh" | ||
secretKey: "ssshhh", | ||
unauthenticated: [/\/posts[\s\S]*/, "/users/resetPassword"] | ||
}, | ||
controllers: { | ||
dir: path.resolve(__dirname, "controllers"), | ||
unauthenticated: [/\/posts[\s\S]*/, "/users/resetPassword"] | ||
dir: path.resolve(__dirname, "controllers") | ||
}, | ||
@@ -218,21 +218,7 @@ database: { | ||
*globally* | ||
### Application | ||
```javascript | ||
const parch = new parch.Application({ | ||
database: { | ||
associations: { | ||
lazyLoad: false | ||
} | ||
} | ||
}); | ||
``` | ||
## Authentication and Authorization | ||
Authentication and authorization is handled using [jwt](), with more options coming | ||
in the future. To disable auth for controllers or their methods, use the | ||
`controllers.unauthenticated` array. Empty by default, you can add an entire controller, | ||
Authentication and authorization is handled using [jwt](https://jwt.io/), with more options coming | ||
in the future. To disable auth for specific routes, use the | ||
`authentication.unauthenticated` array. Empty by default, you can add an entire controller, | ||
or a controller's method. | ||
@@ -242,4 +228,4 @@ | ||
const parch = new parch.Application({ | ||
controllers: { | ||
unauthenticated: ["posts", "users:resetPassword"] | ||
authentication: { | ||
unauthenticated: [/\/posts[\s\S]*/, "/users/resetPassword"] | ||
} | ||
@@ -246,0 +232,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25953
18
221
4
250
+ Addedlodash@^4.13.1
+ Addedlodash@4.17.21(transitive)