Move host-meta to its own file
This commit is contained in:
parent
be6aa89c39
commit
19d7d1ae52
|
@ -27,8 +27,9 @@ import {
|
|||
} from './controllers/api/statuses.ts';
|
||||
import { streamingController } from './controllers/api/streaming.ts';
|
||||
import { indexController } from './controllers/site.ts';
|
||||
import { hostMetaController } from './controllers/well-known/host-meta.ts';
|
||||
import { nostrController } from './controllers/well-known/nostr.ts';
|
||||
import { hostMetaController, webfingerController } from './controllers/well-known/webfinger.ts';
|
||||
import { webfingerController } from './controllers/well-known/webfinger.ts';
|
||||
import { auth19, requireAuth } from './middleware/auth19.ts';
|
||||
import { auth98 } from './middleware/auth98.ts';
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import { Conf } from '@/config.ts';
|
||||
|
||||
import type { AppController } from '@/app.ts';
|
||||
|
||||
const hostMetaController: AppController = (c) => {
|
||||
const template = Conf.local('/.well-known/webfinger?resource={uri}');
|
||||
|
||||
c.header('content-type', 'application/xrd+xml');
|
||||
|
||||
return c.body(
|
||||
`<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="${template}" type="application/xrd+xml" /></XRD>`,
|
||||
);
|
||||
};
|
||||
|
||||
export { hostMetaController };
|
|
@ -91,13 +91,4 @@ function renderWebfinger({ pubkey, username, subject }: RenderWebfingerOpts): We
|
|||
};
|
||||
}
|
||||
|
||||
const hostMetaController: AppController = (c) => {
|
||||
const template = Conf.local('/.well-known/webfinger?resource={uri}');
|
||||
|
||||
c.header('content-type', 'application/xrd+xml');
|
||||
return c.body(
|
||||
`<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="${template}" type="application/xrd+xml" /></XRD>`,
|
||||
);
|
||||
};
|
||||
|
||||
export { hostMetaController, webfingerController };
|
||||
export { webfingerController };
|
||||
|
|
Loading…
Reference in New Issue