0

I've built a small single-page web application in React and seen that it's possible to serve the app as a static site on something like S3.

Previously, I considered using Nginx, but as this is lower cost I'm thinking of using this method instead.

Are there any drawbacks to this method that I should consider?

1
  • 1
    The drawback is that you cant have any backend processing. But if you don't need that, serving it as a static site is fine.
    – JacquesB
    Commented Mar 23 at 17:30

1 Answer 1

3

Assuming you mean the front end only, then yes. The APIs aren't static and must be hosted accordingly. But the SPA can be hosted static.

Our production SaaS in Azure has about 20 Static Web Apps (a mix of Angular and Vue) being serviced by APIs in a mix of Containers and Web Services.

We do this to allow different client specific SPAs to share APIs.

If it was a one-to-one of SPA / API, it wouldn't make as much sense for our needs.

Another reason to keep the SPA and API separate is deployment. It may cost sightly more in hosting, but if you're updating one app much more often than the other then it might be OK. There would be arguably less deployment overhead by only deploying either the APP or API when needed.

Bottomline is just because you can doesn't always mean you should. For our business case the answer was yes. Yours might be different.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.