Merge branch 'configurable-local-port' into 'main'
Allow configuring the local port ditto listens on See merge request soapbox-pub/ditto!181
This commit is contained in:
commit
620fd6bb74
|
@ -39,6 +39,11 @@ class Conf {
|
||||||
['sign', 'verify'],
|
['sign', 'verify'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get port() {
|
||||||
|
return parseInt(Deno.env.get('PORT') || '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.port }, app.fetch);
|
||||||
|
|
Loading…
Reference in New Issue