@@ -61,35 +61,36 @@ var app = new FastBoot({ distPath: distPath });
61
61
62
62
var serveACheekyFile = ( path , staticPath , fileBuffer ) => {
63
63
// 1. Early exit bail
64
- var isAssetValidPath = validAssetPaths . find ( p => p . includes ( path ) ) ;
64
+ var isAssetValidPath = validAssetPaths . find ( p => path . includes ( p ) ) ;
65
+ console . log ( 'INFO validAssetPaths:' , validAssetPaths ) ;
65
66
console . log ( 'INFO isAssetValidPath:' , isAssetValidPath ) ;
66
67
if ( ! isAssetValidPath ) { throw true ; }
67
68
68
- // 1 . Look up files content type.
69
+ // 2 . Look up files content type.
69
70
var contentType = mime . lookup ( staticPath ) ;
70
71
71
- //2 . Get file extension.
72
+ //3 . Get file extension.
72
73
var extension = mime . extension ( contentType ) ;
73
74
74
- //3 . If it isn't a standard file, then base64 encode it.
75
+ //4 . If it isn't a standard file, then base64 encode it.
75
76
var shouldEncode = stringyExtensions . indexOf ( extension ) < 0 ;
76
77
77
- //4 . Determine if the item is fingerprinted/cacheable
78
+ //5 . Determine if the item is fingerprinted/cacheable
78
79
var shouldCache = staticPath . includes ( defaults . assetsPath ) ;
79
80
80
- //5 . Set encoding value
81
+ //6 . Set encoding value
81
82
var encoding = shouldEncode ? 'base64' : 'utf8' ;
82
83
83
- //6 . Create headers
84
+ //7 . Create headers
84
85
var headers = {
85
86
'Content-Type' : contentType ,
86
87
'Cache-Control' : shouldCache ? fancyACacheYeh . yes : fancyACacheYeh . no
87
88
} ;
88
89
89
- //7 . Create body
90
+ //8 . Create body
90
91
var body = fileBuffer . toString ( encoding ) ;
91
92
92
- //8 . Create final output
93
+ //9 . Create final output
93
94
var payload = {
94
95
statusCode : 200 ,
95
96
headers : headers ,
0 commit comments