import config from 'config' const baseURL = config.get('service.baseURL') /** * host-meta endpoint * @type {import('express').RequestParamHandler} */ export const xmlMeta = async (_req, res) => { return res.set('Content-Type', 'text/xml') .send(``) } /** * host-meta.json endpoint * @type {import('express').RequestParamHandler} */ export const jsonMeta = async (_req, res) => { return res.json({ 'links': [ { 'rel': 'lrdd', 'template': `${baseURL}/.well-known/webfinger?resource={uri}` } ] }) } /** * nodeinfo endpoint * @type {import('express').RequestParamHandler} */ export const nodeinfo = async (_req, res) => { return res.json({ 'links': [ { 'rel': 'https://nodeinfo.diaspora.software/ns/schema/2.0', 'href': `${baseURL}/.well-known/nodeinfo/2.0` } ] }) }