Skip to content

Commit

Permalink
Merge pull request #38 from ph0bos/set-etag-false-default
Browse files Browse the repository at this point in the history
published 0.6.5
  • Loading branch information
ph0bos authored Feb 12, 2018
2 parents de38682 + ec7fb30 commit b7958c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ app.use(micro([options]));
- `correlationHeaderName`: `String` The name of your correlation header. Defaults to `X-CorrelationID`.
- `enableBodyParsing`: `boolean` Enable or disable body parsing, useful to disable when dealign with content other than JSON. Enables express-validator. Defaults to `true`.
- `validatorOptions`: `object` Enable express-validator with these options. Defaults to `null`.

- `etag`: `boolean` Activate etag.

## SWAGGER Integration

Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var buildOptions = function(options) {
options.correlationHeaderName = options.correlationHeaderName || 'X-CorrelationID';
options.enableBodyParsing = options.enableBodyParsing || true;
options.validatorOptions = options.validatorOptions || null;
options.etag = options.etag || false;

// Return now if we have no config
if (!config.app) {
Expand Down
5 changes: 5 additions & 0 deletions lib/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ module.exports = function (app, options) {
// Enable CORS
app.use(cors({ preflightContinue: true }));

// Disable etag
if (options.etag === false){
app.set('etag', false);
}

// Setup Cache Control
app.use(cache());

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-microservice-starter",
"version": "0.6.4",
"version": "0.6.5",
"description": "An express-based Node.js API bootstrapping module for microservices.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b7958c0

Please sign in to comment.