| 14 | const publicLibConfig = getPublicLibConfig(); | 14 | const publicLibConfig = getPublicLibConfig(); |
| 15 | const outputPath = publicLibConfig.output?.path; | 15 | const outputPath = publicLibConfig.output?.path; |
| 16 | const outputFile = publicLibConfig.output?.filename; | 16 | const outputFile = publicLibConfig.output?.filename; |
| | 17 | const parsedPath = path.parse(req.path); |
| 17 | | 18 | |
| 18 | if (req.method === 'GET' && path.parse(req.path).base === outputFile) { | 19 | if (req.method === 'GET' && parsedPath.dir === '/' && parsedPath.base === outputFile) { |
| 19 | return res.sendFile(outputFile, { root: outputPath }); | 20 | return res.sendFile(outputFile, { root: outputPath }); |
| 20 | } | 21 | } |
| 21 | | 22 | |