allow configuring the local port ditto listens on
This commit is contained in:
parent
2bffb667c4
commit
3880f1e013
|
@ -39,6 +39,11 @@ class Conf {
|
|||
['sign', 'verify'],
|
||||
);
|
||||
}
|
||||
|
||||
static get localPort() {
|
||||
return parseInt(Deno.env.get('DITTO_LISTEN_ON') || '8000');
|
||||
}
|
||||
|
||||
static get relay(): `wss://${string}` | `ws://${string}` {
|
||||
const { protocol, host } = Conf.url;
|
||||
return `${protocol === 'https:' ? 'wss:' : 'ws:'}//${host}/relay`;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import '@/precheck.ts';
|
||||
import '@/sentry.ts';
|
||||
import app from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
|
||||
Deno.serve(app.fetch);
|
||||
Deno.serve({ port: Conf.localPort }, app.fetch);
|
||||
|
|
Loading…
Reference in New Issue