mirror of
https://github.com/dergigi/boris.git
synced 2025-12-18 15:14:20 +01:00
feat: add local relay support and centralize relay configuration
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
getArticlePublished,
|
||||
getArticleSummary
|
||||
} from 'applesauce-core/helpers'
|
||||
import { ARTICLE_RELAYS } from '../config/relays'
|
||||
|
||||
export interface ArticleContent {
|
||||
title: string
|
||||
@@ -95,15 +96,10 @@ export async function fetchArticleByNaddr(
|
||||
|
||||
const pointer = decoded.data as AddressPointer
|
||||
|
||||
// Define relays to query
|
||||
// Define relays to query - prefer relays from naddr, fallback to configured relays (including local)
|
||||
const relays = pointer.relays && pointer.relays.length > 0
|
||||
? pointer.relays
|
||||
: [
|
||||
'wss://relay.damus.io',
|
||||
'wss://nos.lol',
|
||||
'wss://relay.nostr.band',
|
||||
'wss://relay.primal.net'
|
||||
]
|
||||
: ARTICLE_RELAYS
|
||||
|
||||
// Fetch the article event
|
||||
const filter = {
|
||||
|
||||
Reference in New Issue
Block a user