Angular2 frontend Spring Boot backend on Google cloud platform

I have Angular2 frontend and Java Spring core with my REST endpoints.

Now I want to deploy this app to google cloud platform but want to keep separate projects.

All I've read is deploying one application, but I want my interface and interface to be separate from each other.

How can I deploy individual projects to google cloud platform and report them here?

Thank you for your help!

+3


source to share


1 answer


The easiest way to do this in GCP is to host the frontend in the cloud and set up your server in Google Compute Engine (GCE) or App Engine.

Frontend

Cloud storage provides static hosting capabilities. You can upload your frontend files to cloud storage and configure your domain to serve content from that bucket. Here is a tutorial for setting up a bucket for static hosting.

Once your REST server endpoints are configured, the frontend can easily communicate with them using Angular AJAX capabilities.



Backend

If you prefer direct access to the machine your server is running on, you can load the database code into a GCE instance and start the server there. Otherwise, I would recommend deploying a server with App Engine, which will manage the instances for you.

One of the questions that might interest you is setting up permssions for your backend endpoints. If you want to restrict access to these endpoints and only allow your interface to communicate with them, try using the functions

+2


source







All Articles