(router, path, file, appendFileName = true)
| 234 | * @param next {Function} Express.js next callback |
| 235 | */ |
| 236 | export function routeResolvedFile (router, path, file, appendFileName = true) { |
| 237 | const fullPath = appendFileName ? path + file.match(/[^/]+$/) : path |
| 238 | const fullFile = fileURLToPath(import.meta.resolve(file)) |
| 239 | router.get(fullPath, (req, res) => res.sendFile(fullFile)) |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * Returns the quota for a user in a root |
no test coverage detected