feat: replace hardcoded relay URL with config variable

This commit replaces hardcoded relay server URL with a configuration variable in services.php. The relay URL is now fetched from the environment variable NOSTR_RELAY. This change has been made in the files Election:year.blade.php and admin/Election:year.blade.php under association/election directory.
This commit is contained in:
fsociety
2024-09-29 19:38:26 +02:00
parent dd2b5bf3c2
commit a4052b1ed5
3 changed files with 21 additions and 18 deletions

View File

@@ -126,7 +126,7 @@ $loadEvents = function () {
$requestMessage = new RequestMessage($subscriptionId, $filters);
$relays = [
new Relay('ws://relay:7000'),
new Relay(config('services.relay')),
];
$relaySet = new RelaySet();
$relaySet->setRelays($relays);
@@ -134,7 +134,7 @@ $loadEvents = function () {
$request = new Request($relaySet, $requestMessage);
$response = $request->send();
$this->events = collect($response['ws://relay:7000'])
$this->events = collect($response[config('services.relay')])
->map(fn($event)
=> [
'id' => $event->event->id,