mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
allow configuring the local port ditto listens on
This commit is contained in:
parent
2bffb667c4
commit
3880f1e013
2 changed files with 7 additions and 1 deletions
|
|
@ -39,6 +39,11 @@ class Conf {
|
||||||
['sign', 'verify'],
|
['sign', 'verify'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get localPort() {
|
||||||
|
return parseInt(Deno.env.get('DITTO_LISTEN_ON') || '8000');
|
||||||
|
}
|
||||||
|
|
||||||
static get relay(): `wss://${string}` | `ws://${string}` {
|
static get relay(): `wss://${string}` | `ws://${string}` {
|
||||||
const { protocol, host } = Conf.url;
|
const { protocol, host } = Conf.url;
|
||||||
return `${protocol === 'https:' ? 'wss:' : 'ws:'}//${host}/relay`;
|
return `${protocol === 'https:' ? 'wss:' : 'ws:'}//${host}/relay`;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import '@/precheck.ts';
|
import '@/precheck.ts';
|
||||||
import '@/sentry.ts';
|
import '@/sentry.ts';
|
||||||
import app from '@/app.ts';
|
import app from '@/app.ts';
|
||||||
|
import { Conf } from '@/config.ts';
|
||||||
|
|
||||||
Deno.serve(app.fetch);
|
Deno.serve({ port: Conf.localPort }, app.fetch);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue