Skip to content

Commit 2e97bdd

Browse files
authored
fix(docs): list example and index option (#235)
1 parent a1a02cd commit 2e97bdd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ This function allows filtering the served files.
173173
If the function returns `true`, the file will be served.
174174
If the function returns `false`, Fastify's 404 handler will be called.
175175

176+
#### `index`
177+
178+
Default: `undefined`
179+
180+
Under the hood we use [send](https://github.com/pillarjs/send#index) lib that by default supports "index.html" files.
181+
To disable this set false or to supply a new index pass a string or an array in preferred order.
182+
176183
#### `list`
177184

178185
Default: `undefined`
@@ -187,6 +194,7 @@ Default response is json.
187194
fastify.register(require('fastify-static'), {
188195
root: path.join(__dirname, 'public'),
189196
prefix: '/public/',
197+
index: false
190198
list: true
191199
})
192200
```

0 commit comments

Comments
 (0)