UI application in Pivotal Cloud Foundry - spring

I have a UI application built using Angular , Bootstrap and HTML5 which interacts with number of backend services. In order to deploy this application in PCF , should this be converted to a Spring Boot app? Or is there a way to use any of available buildpacks to deploy this UI app in PCF?

In case there is no need to deploy backend services, I would go with the cloudfoundry static buildpack.
http://docs.cloudfoundry.org/buildpacks/staticfile/index.html
Otherwise you will need to decide how you are going to deploy the backend services for this application. There are a number of buildpacks available that could be used for deploying the backend services and delivering the frontend content within the same app (one of them being, as you mentioned the java buildpack that can be used to deploy a spring boot app). Here is a list of available buildpacks:
http://docs.cloudfoundry.org/buildpacks/

Its not needed to convert your application to spring boot, but doing so will definitely make life easier for you, trust me. Once u convert ur app to a spring boot right, you can remote debug ur application by jst running ur app as a spring boot app.

Related

How can I deploy a Spring Boot REST API to BanaHost cPanel?

I created a full stack application (Angular front end, java spring boot back end, mysql database), and I was able to upload successfully both the angular files and mysql into BanaHost cPanel, however I have not found useful information on how to upload spring boot REST API, as a consequence only the front end is working. How can I deploy this REST API on cpanel?
Spring Boot Applications can't just upload and deploy if you're utilizing a cPanel Web hosting (shared) plan, like you deployed the Angular Application by uploading.
For spring boot you must do it yourself, a Virtual Private Server or Dedicated Server will unlock the site hosting restriction. If you are not much familiar with the Linux command line, you can use a Window VPS instead. Providers like, Digital Ocean, Linode, and Oracle Cloud all provide free trials.
And also, there are platforms, such as Heroku (Platform as a Service(PaSS)), where you can deploy your app without the need for a VPS. You can refer their documentation regarding this:
https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku

Deploy my spring boot application into google cloud computer engine

I got a query to ask you all. I am looking for guides that help me deploy my spring boot application on google cloud computer engine, I type in my instance IP address when I test my spring boot application I unable to access it in REST API.
May I know do you have any guides or steps for me to follow to deploy successfully in google cloud computing engine. Why do I need to deploy in computer engine is because I deployed my angular at it and I deploy it both it seems that my angular project being replaced by my spring boot application.
Codelabs GCP / Spring series has deployment tutorials:
https://codelabs.developers.google.com/spring/
GCP has some "Getting Started" tutorials you can use here:
https://cloud.google.com/java/docs/
where the specific one for deploying a java app to GCE is here:
https://cloud.google.com/java/docs/tutorials/bookshelf-on-compute-engine
But the basic steps are as follows:
Write your Spring app
Build your Spring app
Run / test your jar locally
Push your jar to a location in Storage
Create a startup script for your GCE instance
Create a new GCE VM which uses your startup script using Console, Deployment API, or gcloud tool
After that, you need to ensure you have the proper network rules in place to be able to access your API publicly. If you do not wish to learn how to use GCE, I would suggest you look into using App Engine instead because then you do not need to learn how to deploy and instead can concentrate on your api. Here is a guide to do that

How to build and deploy Spring Boot no-web app to TomEE?

I have a simple Spring Boot JMS app like this. It have no web-layer and I don't want to add web layer to that app. It should be just one JMS microservice, hidden from web.
But I want to run it inside TomEE (as EJB or something). How can I do it?
you can deploy your app as an ear without any webmodule. Alternatively you can deploy it to openejb-standalone instead of tomee.

How enable Angular Universal with a Java/Spring backend?

I have an app, where backend implements on Spring using Spring Boot and front-end side use Angular2. Can somebody help me and explain how to integrate Universal using Java becken. Or show me a good example how I can do that.
how to integrate Universal using Java beckend?
You cannot do that directly as universal needs a different server side technology -nodejs
But you have a another (better) solution
Spin off a separate nodejs app for the angular and universal then route all the API calls through the nodeJs to your Spring boot application. Now your spring boot application will be just a (micro)service which will only deal with the data, not the presentation (markup/style etc)

Angular2 application with springboot using maven

I am new to Springframework. I created a Springboot application and expose rest services. Now I want to consume my rest services in angular2. I am not sure how to create folder structure for my application. Should I create angular2 app in src/main/resources folder using angular cli? or as I am exposing rest services so should I create a separate angular project and consume the services? But if user this approach it will run on two different ports on localhost and I get CrosOrigin error.
In production I will deploy the application on same server. It will be a one website.
One more point I am using Maven and STS tool suit to create springboot application.
For a Spring-Boot novice using AngularJS you might be checking out JHipster (which actually is a combination of these two projects), which might serve you with some best practices.
Currently based on AngularJS 1 - it's not Angular2 yet - however they're busy porting it to version 2 (see progress, see this branch).
Alternatively there's also a guide on how to create a standalone Spring-Boot application with AngularJS (1).
I find some sample code but even in Springboot application you have to run spring and angular application on two different ports on local host. So the best way to solve the problem is to create two application expose services in spring boot and use in angular client side. While running on local use enable CORS.
Another way is to use JHipster. They recently release JHipster 4 which support angular 2.

Resources