How do I consume an API without making a full-blown JS SPA. I need the website to be light-weight and fast loading. However, all relevant content is going to come from an API. How do I do this in the most lightweight way possible?<p>I have very little JS experience. I mostly work with Python on the backend.
The API already exists? The very simplest thing to do in 2020 (assuming modern browsers) is to use fetch: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/U...</a><p>Having said that, you probably still need to think a little about auth etc. Depends on what you're doing. If it's all internal then it's fine but otherwise you need some notion of who the caller is and they need to send something with each request that's checked on the python backend.