Frontend app (react) unable to connect to backend URL(in node) in openshift - node.js

I am using sandbox account of openshift and deployed one react frontend and one node backend app however from frontend when i am calling backend location URL generated by openshift, frontend is crashing. i researched a little and cam eot know that both have to be on same network. How to make sure they can talk to each other? I am new to openshift please help.

Related

How to deploy Node.js & Express.js Backend to be used by Next.js Frontend via Vercel?

ho guys, i want to deploy my next.js application to vercel. well there's no problem about that. But for the reason of a scalable application i have my used backend written separately in Node.js. I also want this to be used with the Next.js Frontend preferably by hosting it on vercel.
So is this possible by default? I don't understand how to achieve this and what will be the necessary steps after having the backend, say, deployed on vercel.
Can you elaborate?
unfortunately you cannot host a backend on Vercel. If you want to host a backend simply you should look at Heroku or Railway. You should then be able to connect your Vercel frontend to your backend hosted by Heroku or Railway

How to deploy Front end and backend on Plesk

I am trying to deploy my Front-end React and backend Rest api's in node.js, The server is being accessed with plesk dashboard. I was successfully able to deploy my front-end following these steps by deploying build and changing root folder https://www.plesk.com/blog/product-technology/node-js-plesk-onyx/
But here I do not find a way to deploy my backend node.js rest api on different port as we do in vps via terminal, i couldn't find way to access terminal either.
On Creating subdomain and redoing the same steps to deploy node.js-plesk I get ip address not found api.domain.digital’s server IP address could not be found.

Can I only deploy the server side of my react native app to Heroku?

I have a react native app that I'm building using expo. For the backend, I am using node.js and Express.
My app hierarchy is such that I have a frontend folder and a backend (server) folder. For example,
Root
|
|Frontend
|Various screens & associated files
|Server
|Routes & other files
For my project, is it possible to just host the backend and not the rest of the app? Such that when I fetch data in the frontend using HTTP requests, instead of routing through localhost (http: //RandomIP:PORT/route) I would use the heroku address as the routing address. I would also host the SQL database along with it.
I tried to follow along with the Heroku documentation, but it seemed like that was for hosting the entirety of the app / web apps instead of mobile, and I ran into constant errors.
I would like to point out that, unlike web pages, mobile apps cannot be hosted on the server and fetched on-demand. In other words, do not try to upload your react-native code to Heroku instead just upload your backend only and then make HTTP requests through the URL provided by Heroku after you have deployed your code.
Therefore go into your backend codebase, initialize a git repository and just deploy that Heroku. Also, you will need to host your SQL database on another service such as Google's Cloud SQL or Amazons AWS Database Services.

how to deploy the nodejs expressjs for api, reactjs for frontend and angular for admin

How can we deploy the nodejs with SSL certificates,
I have expressjs for API, reactjs for front-end and angular for backend,
i need a path like - https://www.domainname.com - for frontend https://www.domainname.com/admin for admin and expressjs api run on background with https. like https://www.domainname.com/api/register
I have merge the expressjs and reactjs into one project and it works fine on local machine but how i can run the admin like - http://localhost/admin (it works with port like http://localhost:4200) but i want with admin. Please let me how to achieve.
You could host your admin application separately and use a CDN like Cloudflare to serve it as a subdomain (admin.domainname.com). Cloudflare comes with free SSL.

How do you connect an S3 hosted frontend to a Elastic beanstalk hosted backend?

I have run npm build on my react app and have opened an S3 bucket on AWS, changed it to become a static website host, and have uploaded the contents of the react build folder into it. I'm now able to access the frontend part.
My backend, running on node & express, is in a different package alltogether. Throughout development I ran both "nodemon app" and "npm start" separately and connected the two through a proxy.
I have used Elastic Beanstalk before to run a webapp, but the whole package was in one before and I never had to connect 2 server instances, so I'm lost as to how I can have the frontend send POST requests and connect to the websockets from S3 to EBS.
For example, my frontend connected to the backend during development with this:
endpoint: 'http://localhost:3000'
this.state.io = socket.connect(this.state.endpoint);
Do I now change that to the domain name of the EBS instance?
I also use Axios for my POST requests. How does the frontend know to connect to my EBS specifically?
Any help would be appreciated, thank you.
Set the endpoint to the domain where your API is hosted. That should be Elastic Beanstalk. To avoid CORS issues, it'd be easier if you set it all up under one domain. You would probably need CloudFront for that, or you can take a shortcut and have Apache on your Elastic Beanstalk proxy requests to S3.

Resources