diff --git a/README.md b/README.md index e54a70e..f8e66bd 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,9 @@ server: ip: 0.0.0.0 compress: false header: true + serveStatic: + extensions: + - html ``` - **port**: Server port @@ -40,6 +43,7 @@ server: - **ip**: Server IP - **compress**: Enable GZIP compression - **header**: Add `X-Powered-By: Hexo` header +- **serveStatic**: Extra options passed to [serve-static](https://github.com/expressjs/serve-static#options) ## License diff --git a/lib/middlewares/static.js b/lib/middlewares/static.js index 8c32d9b..3a18db4 100644 --- a/lib/middlewares/static.js +++ b/lib/middlewares/static.js @@ -3,5 +3,5 @@ var serveStatic = require('serve-static'); module.exports = function(app) { - app.use(this.config.root, serveStatic(this.public_dir)); + app.use(this.config.root, serveStatic(this.public_dir, this.config.server.serveStatic)); };