diamond (she/they)

  • 4 Posts
  • 24 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle
rss



















  • The websocket needs the right URL or it won’t work, you can’t always assume the websocket endpoint is at the root of the domain.

    Right. I was reading a code snippet from somewhere else where they called into the root path, but the library that they were using probably did the appending in the background which I didn’t know.

    That’s annoying, though, because setting up the right CORS headers to allow arbitrary online clients is a pain and I suspect many instance admins won’t do it.

    There is an issue upstream tracking this. For now, I only mostly use Beehaw, so that’s fine.

    As a side note, are you implementing the API from scratch? Because there’s a Javascript (Typescript) API that gets auto generated from the Lemmy sources that’s ready to use (supports both REST and WS).

    Nope, I’m using lemmy-js-client. The WS part of it doesn’t do much, so I didn’t bother using it. The LemmyWebsocket type wasn’t also in the main import for some reason, but that wasn’t much of an issue.