Web developer.

  • 84 Posts
  • 442 Comments
Joined 1 year ago
cake
Cake day: January 4th, 2024

help-circle




  • Pretty much what fxomt said. The endpoint urls are the same but on some a few parameters are different and some of the returned JSON is structured slightly differently.

    When Lemmy releases 1.0 and makes big changes their API, PieFed will not be trying to make compatible changes. We’ll also be wanting to add new endpoints for PieFed-only features like feeds so the differences will increase over time.







  • It’s working for me. Try this:

    <!-- Save this as test-cors.html and open in a browser -->
    <!DOCTYPE html>
    <html>
      <body>
        <script>
          fetch("https://piefed.social/api/alpha/comment?id=6527216", {
            method: "GET", // or "POST", etc.
            headers: {
              "Content-Type": "application/json"
            }
          })
          .then(response => response.text())
          .then(data => console.log("Success:", data))
          .catch(error => console.error("CORS Error:", error));
        </script>
      </body>
    </html>