The springbootApp I put on vps is not working - spring-boot

Basically, I purchased a server that has to host a React WebApp and Sprinboot API as a backend server. the react is turning fine on the server but I cannot seem to be able to make the springboot work.
In order to make the React work I had to use nginx , do I need to do the same thing for the Springboot app ? And since the nginx configuration is already devised for the React app how should i modify it to allow it to run both the React and the Springboot.
Here's my nginx configuration:
nginx config file
I tried following several videos but I can't seem to piece together the elements of the solution I'm searching for.

Related

Ideal place to deploy a springboot web backend and a nextjs frontend

I just wanted to know, if someone could suggest me some sites, where i can deploy my springboot backend connected to a mysql database. My frontend is build with nextjs/react.
You can try Render or Heroku if you don't want to operate a whole Kubernetes cluster.

Expose Strapi Prometheus Metrics on another Port

I’m using strapi v4 along with the prometheus plugin and right now my app metrics are being exposed on http://localhost:1337/api/metrics
But I need it to be on another port like http://localhost:9090/metrics (also removing the api prefix).
So strapi and the rest of the backend would still be running on port 1337 and only the metrics on 9090
I've been through the documentation but it seems like there is no configuration for that. Can anybody help think of a way to do this?
Right now the metrics don't run on a separate server. They run on the same server as strapi.
This is to be able to use the user-permissions plugin and the API token of strapi to secure the endpoint.
In the future, I could look into making it an option to create a separate server.

Run two apps on one heroku domain

I have two apps, one is a react app being served on a node server (front end). Another one is a Spring boot app (backend that provides bunch of REST API endpoints). They live on two different github repos.
Is there a way to configure heroku to serve both of them (they run on different ports) on one domain?
Right now, I have the java spring boot app being served on one heroku domain, I want the second react project to build and run on the same domain. Any idea ?

How to integrate Angular 2 to existing J2EE Spring project and Run it on same PORT?

I have existing project with a Spring on a back-end and AngularJS 1 on front-end. When I run the Spring server - opens just 1 port for me: 8080 and I can access REST APIs and also AngularJS front-end stuff through it.
But now I want to move to new Angular 2.
How do I make it use same port: 8080 both for APIs and Angular 2?
The reason why I asking about this, is that almost each tutorial that I find offers to use Angular CLI(npm install -g angular-cli) https://cli.angular.io/ stuff that installs another lite server with it and then I have to run it on a different port.
How to install minimum required dependencies for Angular 2 and without its own Server?
Like tutorial like that:
https://www.youtube.com/watch?v=HhroyiYFmjc
REST API run on port: 8080
Angular2 on port: 3000
To deploy your app generated by Angular CLI under your Java server, you can run ng build (or ng build --prod) and copy the content of the files generated in the dist dir to your server to the static dir.
In dev mode, if you want to keep running the app with the dev server (it runs on the port 4200 by default), you can configure a proxy by creating a file proxy-config.json in your Angular project with the following content (assuming the api is the part of the deployed URL):
{
 "/api": {
"target": "http://localhost:8080",

 "secure": false
 }

}
Now you can run the app in dev mode using the following command:
ng serve --proxy-config proxy.conf.json
This will allow your dev server (port 4200) to access the REST API on port 8080.

Uploading Angular 2 app to web hosting

So far I've used web hosting such as https://uk.godaddy.com/hosting/web-hosting for my websites, but seem like running angular 2 app has different way for publication.
So, since I found nothing about running Angular 2 app to be available public, and not only in localhost
My questions are -
What providers do allow such apps to be hosted on them? now I'm using npm start in my project folder to run my app, does it works the same way?
Since my backend is Laravel and supposed to be in the same domain as the Angular2 frontend, These providers allow to host the API's too?
Thanks in advance!
I have also hosted my laravel backend and angular front end using openshift. In terms to your application, I recommend you the following two providers.
Amazon Web Service. You can get 1 year free trial, EC2 is really wonderful to host whatever you want. In EC2, you can configure the environment for angular 2 and laravel by yourself. You can run any command including npm install in EC2
Openshift. You can freely create 3 gears to host your application. The environment is very easy to configure. If you want
to deploy angular 2, laravel applications, there are specific gears for these frameworks, so openshift
should be the best choice.
The answer to your second question : Yes, they allow to host the APIs !

Resources