Websockets sucks.
The UX on nostr would be so much better if relays also had a rest API or something like that
Websockets sucks.
The UX on nostr would be so much better if relays also had a rest API or something like that
agreed. would love an option to sync notes from a zip file as well
should be easy to augment relays with REST endpoints right?
Sure
Gonna add this to https://github.com/zapstore/ftsrelay
So send the REQ in a JSON payload I assume
https://github.com/rust-nostr/nostr-rest/blob/master/src/handler.rs
I liked the way is done here just send the event in the body for publishing an event or send the filters in the body when getting events
Could also have a /event/id endpoint
Websockets are truly horrible to work with. But we need them anyway to support streaming. So HTTP isn't an alternative. It's an additional option, adding complexity.
Websockets can be mastered though. So we just need to build perfect libraries in each language. In theory this work only needs to be done once, then it will be easy for all future developers.
I think is a lot more complex fixing all websockets libraries than add some http endpoints to a relay.
You can reuse a lot of the code
what's the hassle?
Encourages bad coding, high data usage, infinity loading screens etc.
You can see this basically in all clients
Yeah, I'm not convinced that many of nostr use cases are made better with data streams, in general. And I makes a lot of functionality pretty wasteful.