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

Function handler

lib/handlers/delete.mjs:3–21  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

1import { handlers as debug } from '../debug.mjs'
2
3export default async function handler (req, res, next) {
4 debug('DELETE -- Request on' + req.originalUrl)
5
6 const ldp = req.app.locals.ldp
7 try {
8 await ldp.delete(req)
9 debug('DELETE -- Ok.')
10 res.sendStatus(200)
11 next()
12 } catch (err) {
13 debug('DELETE -- Failed to delete: ' + err)
14
15 // method DELETE not allowed
16 if (err.status === 405) {
17 res.set('allow', 'OPTIONS, HEAD, GET, PATCH, POST, PUT')
18 }
19 next(err)
20 }
21}

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected