File tree 1 file changed +3
-9
lines changed
1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -23,20 +23,16 @@ export class FastifyLoader extends AbstractLoader {
23
23
( ) => require ( 'fastify-static' )
24
24
) ;
25
25
26
- optionsArr . forEach ( options => {
26
+ optionsArr . forEach ( ( options ) => {
27
27
options . renderPath = options . renderPath || DEFAULT_RENDER_PATH ;
28
28
29
- const { setHeaders, redirect, ...send } =
30
- options . serveStaticOptions || ( { } as any ) ;
31
29
const clientPath = options . rootPath || DEFAULT_ROOT_PATH ;
32
30
const indexFilePath = this . getIndexFilePath ( clientPath ) ;
33
31
34
32
if ( options . serveRoot ) {
35
33
app . register ( fastifyStatic , {
36
34
root : clientPath ,
37
- setHeaders,
38
- redirect,
39
- send,
35
+ ...options . serveStaticOptions ,
40
36
wildcard : false ,
41
37
prefix : options . serveRoot
42
38
} ) ;
@@ -53,9 +49,7 @@ export class FastifyLoader extends AbstractLoader {
53
49
} else {
54
50
app . register ( fastifyStatic , {
55
51
root : clientPath ,
56
- setHeaders,
57
- redirect,
58
- send,
52
+ ...options . serveStaticOptions ,
59
53
wildcard : false
60
54
} ) ;
61
55
app . get ( options . renderPath , ( req : any , res : any ) => {
You can’t perform that action at this time.
0 commit comments