DEV Community

Discussion on: Vue+Flask on DigitalOcean: how to proceed?

Collapse
 
colinmtech profile image
Colin Morgan

I deployed a side project using Flask/React last week on digital ocean. I just installed nginx and configured a block to serve a static build of the react app and one to serve the flask API via gunicorn. I also setup gitlab CI to build/deploy, which seems to be working pretty good so far.

If your API is being used by the Vue app, it'll need to be public because of the nature of SPAs. You could probably enforce domain referral requirements, but usually you just secure the API with the knowledge that it's publicly available.

Collapse
 
danroc profile image
Daniel da Rocha

If your API is being used by the Vue app, it'll need to be public because of the nature of SPAs.

But that only in this solution or also in @rhymes solution described above?

Collapse
 
rhymes profile image
rhymes

@danroc mine is behind basic authentication. The SPA talks to the API and they both are behind basic authentication (TLS only)

Collapse
 
colinmtech profile image
Colin Morgan

It'll be public in his solution, as well. The only difference is that the initial index.html file will be served via the flask app, instead of just through nginx.