Nostr REST API proxy on Cloudflare Workers.
Client implementation is simplified by having proxy server handle communication
with relays.
It also reduces the amount of communication on client.
{nevent}
is NIP-19
and requires id and relays.
{naddr}
is NIP-19
and requires kind, pubkey, identifier and relays.
{nprofile}
is
NIP-19 and requires
pubkey and relays.
This is an alias of naddr with kind 0 and empty identifier.
{nevent}
is NIP-19
and requires relays.
Request body is event JSON.
Fetch events.
POST method is used because filters can be long.
Request body contains relays and filters.
{
"relays": ["wss://example.com/"],
"filters": [{ "limit": 10 }]
}
This is
Server-Sent Events
with POST method.
POST method is used because filters can be long.
Use a library which can handle POST method
(sse.js,
launchdarkly-eventsource,
eventsource-client,
@microsoft/fetch-event-source,
etc.) instead of
EventSource.
Request body contains relays and filters.
{
"relays": ["wss://example.com/"],
"filters": [{ "limit": 10 }]
}
npm install
npm run dev
cd test/
docker compose up --build -d --wait
npm test
docker compose down --volumes
npm run deploy