File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ This function allows filtering the served files.
173173If the function returns ` true ` , the file will be served.
174174If 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
178185Default: ` undefined `
@@ -187,6 +194,7 @@ Default response is json.
187194fastify .register (require (' fastify-static' ), {
188195 root: path .join (__dirname , ' public' ),
189196 prefix: ' /public/' ,
197+ index: false
190198 list: true
191199})
192200```
You can’t perform that action at this time.
0 commit comments