• 0 Posts
  • 3 Comments
Joined 4 months ago
cake
Cake day: March 8th, 2025

help-circle

  • If you’re building a website, you’ll probably want to stick to Javascript over Rust.

    This MDN article does a pretty good job at introducing the concept of making network requests in Javascript: https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/Network_requests. It focuses on the “fetch” API as the tool for making requests, which is the standard way to make network requests in Javascript. There are other tools like Axios that may make things easier, but “fetch” should be fine for your use case.

    Another concept that will be relevant here is asynchronous programming: https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Async_JS/Introducing. Basically, there will be some delay between when you make the request and when you get a response. So you’ll need to write your logic in a way that does the “waiting” part correctly.

    One important detail is that most APIs use some form of authentication. So when you’re “grabbing the data” from an external site, the site knows who you are and that you are allowed to access that data. Getting authentication right might be a little tricky, but here is an entry point: https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication. Basically, you’ll need to figure out what authentication strategy your headless CMS is using, and then make sure to safely pass those credentials when making your network requests. If the API(s) you are using are public, you won’t need to worry about this.

    If your goal is primarily to get data from an external source, this should be a good starting point. You don’t necessarily need to get too deep into the backend or even the technical details of things like HTTP or REST. However, if you’re interesting in getting a deeper understanding of Web APIs, the other comment talking about building a skeleton API would be a good exercise.


  • This is a helpful article, but this part of the post seems a bit misleading:

    […] falling behind competitors such as Waymo, NAVYA, and Volvo, who all have Level 4 cars in production.

    The article explains that Level 4 cars are only allowed in geofenced areas with low speed limits, which limits the use case to urban robo-taxis. The article also says:

    While the future of autonomous vehicles is promising and exciting, mainstream production in the U.S. is still a few years away from anything higher than Level 2.

    I don’t say this to defend Tesla. Setting aside the obvious political issues, you are right that Tesla’s FSD claim is dangerously misleading, and Tesla has been consistently failing to keep its promised timelines for improving.

    I say this because I am really excited by the idea of fully self driving cars (though I hope they don’t remove the steering controls like the article suggests), and for a second I thought other commercial vehicle options had made significantly improved self-driving available. Unfortunately, the improvements seem to be limited to ride-sharing applications for now.