MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / routeResolvedFile

Function routeResolvedFile

lib/utils.mjs:236–240  ·  view source on GitHub ↗
(router, path, file, appendFileName = true)

Source from the content-addressed store, hash-verified

234 * @param next {Function} Express.js next callback
235 */
236export 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

Callers 2

createAppFunction · 0.90
middlewareFunction · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected