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

Function LdpMiddleware

lib/ldp-middleware.mjs:13–38  ·  view source on GitHub ↗
(corsSettings, prep)

Source from the content-addressed store, hash-verified

11import notify from './handlers/notify.mjs'
12
13export default function LdpMiddleware (corsSettings, prep) {
14 const router = express.Router('/')
15
16 // Add Link headers
17 router.use(linksHandler)
18
19 if (corsSettings) {
20 router.use(corsSettings)
21 }
22
23 router.copy('/*', allow('Write'), copy)
24 router.get('/*', index, allow('Read'), addPermissions, get)
25 router.post('/*', allow('Append'), post)
26 router.patch('/*', allow('Append'), patch)
27 router.put('/*', allow('Append'), put)
28 router.delete('/*', allow('Write'), del)
29
30 if (prep) {
31 router.post('/*', notify)
32 router.patch('/*', notify)
33 router.put('/*', notify)
34 router.delete('/*', notify)
35 }
36
37 return router
38}

Callers 2

createAppFunction · 0.85
initWebIdFunction · 0.85

Calls 7

allowFunction · 0.85
copyMethod · 0.80
patchMethod · 0.80
putMethod · 0.80
deleteMethod · 0.80
getMethod · 0.45
postMethod · 0.45

Tested by

no test coverage detected