* Serves the service capability document (containing server root URL, including * any base path the user specified in config, server API endpoints, etc). * @method serviceCapabilityDocument * @param req * @param res * @param next
()
| 26 | * @param next |
| 27 | */ |
| 28 | function serviceCapabilityDocument () { |
| 29 | return (req, res) => { |
| 30 | const ldp = req.app.locals.ldp |
| 31 | res.json({ |
| 32 | // Add the server root url |
| 33 | root: ldp.resourceMapper.resolveUrl(req.hostname, req.path), |
| 34 | // Add the 'apps' urls section |
| 35 | apps: req.app.locals.appUrls, |
| 36 | api: { |
| 37 | accounts: { |
| 38 | // 'changePassword': '/api/account/changePassword', |
| 39 | // 'delete': '/api/accounts/delete', |
| 40 | |
| 41 | // Create new user (see IdentityProvider.post() in identity-provider.js) |
| 42 | new: new URL('/api/accounts/new', ldp.serverUri), |
| 43 | recover: new URL('/api/accounts/recover', ldp.serverUri), |
| 44 | signin: ldp.resourceMapper.resolveUrl(req.hostname, '/login'), |
| 45 | signout: ldp.resourceMapper.resolveUrl(req.hostname, '/logout'), |
| 46 | validateToken: new URL('/api/accounts/validateToken', ldp.serverUri) |
| 47 | } |
| 48 | } |
| 49 | }) |
| 50 | } |
| 51 | } |
no test coverage detected