diff --git a/README.md b/README.md index 6eb629fd7..98e6461da 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,9 @@ app.use(webpackMiddleware(webpack({ publicPath: "/assets/", // public path to bind the middleware to // use the same as in webpack + + index: "index.html", + // the index path for web server headers: { "X-Custom-Header": "yes" }, // custom headers diff --git a/middleware.js b/middleware.js index f264e78da..89738196b 100644 --- a/middleware.js +++ b/middleware.js @@ -213,7 +213,7 @@ module.exports = function(compiler, options) { var stat = fs.statSync(filename); if(!stat.isFile()) { if(stat.isDirectory()) { - filename = pathJoin(filename, "index.html"); + filename = pathJoin(filename, options.index || "index.html"); stat = fs.statSync(filename); if(!stat.isFile()) throw "next"; } else {