diff --git a/installation/ditto.conf b/installation/ditto.conf index 2a49173..afdf65c 100644 --- a/installation/ditto.conf +++ b/installation/ditto.conf @@ -3,7 +3,7 @@ # Edit this file to change occurences of "example.com" to your own domain. upstream ditto { - server 127.0.0.1:8000; + server 127.0.0.1:4036; } upstream ipfs_gateway { diff --git a/src/config.ts b/src/config.ts index 5a30c0e..6fe62b9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -55,7 +55,7 @@ class Conf { } /** Origin of the Ditto server, including the protocol and port. */ static get localDomain() { - return Deno.env.get('LOCAL_DOMAIN') || 'http://localhost:8000'; + return Deno.env.get('LOCAL_DOMAIN') || `http://localhost:${Conf.port}`; } /** URL to an external Nostr viewer. */ static get externalDomain() { diff --git a/src/storages/EventsDB.test.ts b/src/storages/EventsDB.test.ts index d1986b7..10f0d11 100644 --- a/src/storages/EventsDB.test.ts +++ b/src/storages/EventsDB.test.ts @@ -33,15 +33,15 @@ Deno.test('query events with domain search filter', async () => { await eventsDB.event(event1); assertEquals(await eventsDB.query([{}]), [event1]); - assertEquals(await eventsDB.query([{ search: 'domain:localhost:8000' }]), []); + assertEquals(await eventsDB.query([{ search: 'domain:localhost:4036' }]), []); assertEquals(await eventsDB.query([{ search: '' }]), [event1]); await kysely .insertInto('pubkey_domains') - .values({ pubkey: event1.pubkey, domain: 'localhost:8000', last_updated_at: event1.created_at }) + .values({ pubkey: event1.pubkey, domain: 'localhost:4036', last_updated_at: event1.created_at }) .execute(); - assertEquals(await eventsDB.query([{ kinds: [1], search: 'domain:localhost:8000' }]), [event1]); + assertEquals(await eventsDB.query([{ kinds: [1], search: 'domain:localhost:4036' }]), [event1]); assertEquals(await eventsDB.query([{ kinds: [1], search: 'domain:example.com' }]), []); });