From be0ad60da3e244698554bed8cbf2fd16f2ea0ac0 Mon Sep 17 00:00:00 2001 From: ZiiMakc Date: Tue, 28 Sep 2021 00:40:14 +0300 Subject: [PATCH] fix(docs): list example and index option --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 7686f1d..cc99b02 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,13 @@ This function allows filtering the served files. If the function returns `true`, the file will be served. If the function returns `false`, Fastify's 404 handler will be called. +#### `index` + +Default: `undefined` + +Under the hood we use [send](https://github.com/pillarjs/send#index) lib that by default supports "index.html" files. +To disable this set false or to supply a new index pass a string or an array in preferred order. + #### `list` Default: `undefined` @@ -187,6 +194,7 @@ Default response is json. fastify.register(require('fastify-static'), { root: path.join(__dirname, 'public'), prefix: '/public/', + index: false list: true }) ```