instance: add urls.nostr_relay and pubkey properties to instance
This commit is contained in:
parent
887c68f052
commit
baf4c00fee
|
@ -5,6 +5,9 @@ import type { Context } from '@/deps.ts';
|
|||
function instanceController(c: Context) {
|
||||
const { host, protocol } = Conf.url;
|
||||
|
||||
/** Protocol to use for WebSocket URLs, depending on the protocol of the `LOCAL_DOMAIN`. */
|
||||
const wsProtocol = protocol === 'http:' ? 'ws:' : 'wss:';
|
||||
|
||||
return c.json({
|
||||
uri: host,
|
||||
title: 'Ditto',
|
||||
|
@ -35,10 +38,15 @@ function instanceController(c: Context) {
|
|||
user_count: 0,
|
||||
},
|
||||
urls: {
|
||||
streaming_api: `${protocol === 'http:' ? 'ws:' : 'wss:'}//${host}`,
|
||||
/** Base URL for the streaming API, so it can be hosted on another domain. Clients will add `/api/v1/streaming` to it. */
|
||||
streaming_api: `${wsProtocol}//${host}`,
|
||||
/** Full URL to the Nostr relay. */
|
||||
nostr_relay: `${wsProtocol}//${host}/relay`,
|
||||
},
|
||||
version: '0.0.0 (compatible; Ditto 0.0.1)',
|
||||
email: Conf.adminEmail,
|
||||
/** Ditto admin pubkey, so clients can query and validate Nostr events from the server. */
|
||||
pubkey: Conf.pubkey,
|
||||
rules: [],
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue