Get rid of DITTO_RELAY, derive from LOCAL_DOMAIN

This commit is contained in:
Alex Gleason 2023-08-14 14:40:30 -05:00
parent 78f638e633
commit 16ba224124
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 3 additions and 6 deletions

View File

@ -35,12 +35,9 @@ const Conf = {
['sign', 'verify'],
);
},
get relay() {
const value = Deno.env.get('DITTO_RELAY');
if (!value) {
throw new Error('Missing DITTO_RELAY');
}
return value;
get relay(): `wss://${string}` | `ws://${string}` {
const { protocol, host } = Conf.url;
return `${protocol === 'https:' ? 'wss:' : 'ws:'}//${host}/relay`;
},
get localDomain() {
return Deno.env.get('LOCAL_DOMAIN') || 'http://localhost:8000';