diff --git a/README.md b/README.md index 9334bf7..2ca782e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/index.js b/index.js index 502f22c..7dc8443 100644 --- a/index.js +++ b/index.js @@ -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) { diff --git a/lib/bootstrap.js b/lib/bootstrap.js index 409fd35..a3c990f 100644 --- a/lib/bootstrap.js +++ b/lib/bootstrap.js @@ -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()); diff --git a/package.json b/package.json index 0368394..a4f7765 100644 --- a/package.json +++ b/package.json @@ -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": {