Skip to content

Commit f7507e6

Browse files
Merge branch 'geekdada-master'
2 parents abc7a76 + 1ed10cb commit f7507e6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/loaders/fastify.loader.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ export class FastifyLoader extends AbstractLoader {
2626
optionsArr.forEach(options => {
2727
options.renderPath = options.renderPath || DEFAULT_RENDER_PATH;
2828

29-
const { setHeaders, redirect, ...send } =
30-
options.serveStaticOptions || ({} as any);
3129
const clientPath = options.rootPath || DEFAULT_ROOT_PATH;
3230
const indexFilePath = this.getIndexFilePath(clientPath);
3331

3432
if (options.serveRoot) {
3533
app.register(fastifyStatic, {
3634
root: clientPath,
37-
setHeaders,
38-
redirect,
39-
send,
35+
...(options.serveStaticOptions || {}),
4036
wildcard: false,
4137
prefix: options.serveRoot
4238
});
@@ -53,9 +49,7 @@ export class FastifyLoader extends AbstractLoader {
5349
} else {
5450
app.register(fastifyStatic, {
5551
root: clientPath,
56-
setHeaders,
57-
redirect,
58-
send,
52+
...(options.serveStaticOptions || {}),
5953
wildcard: false
6054
});
6155
app.get(options.renderPath, (req: any, res: any) => {

0 commit comments

Comments
 (0)