Can't access nodejs from external ip in digital ocean - node.js

i want to deploy an vue application with express backend both on one virtual machine on digital ocean . I have successfully deploy vue application and i am able to access it with external ip but express backend is not working i started the server with pm2 but vue application which is hosted and working properly is not able to connect to express bakcend also i am not able to access it through external ip like this :3000
i have enabled port 3000 on firewall my mongo db is working and server is properly doing there stuff

Related

Connect domain to nodejs server hosted on vps instead on ip + port

i have 2 react apps and a nodejs server (express and websocket) running on port 8000.
the express server is for generating random links and the websocket for sending real-time messages between the apps.
my apps worked perfectly after hosting on my vps server but after connecting letsencrypt ssl to both react apps, they don't work anymore because i have to connect to a websocket with secure connection.
so i want to connect the nodejs server with a subdomain i have from namecheap.
i have tried pointing the subdomain i got for the server to the ip of the vps but i don't know what to do after that.
should i create a new file just like i did for the previous apps in the sites-available directory, listen to port 8000, set server name to the intended subdomain and run a proxypass to the same subdomain?
This is my first time hosting on a vps server, i'm very confused at the point but my server works well when i just type in ip:8000 on my brower

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.

HOW to deploy a MERN APP to production, without using firebase or heroku or aws

So people, I'm planning to build a website with MERN Stack and host it from my local machine. How to do that without using aws or fire base.
How to use my machine as Backend and database(express, node and mongodb hosted in local host) for the react frontend (hosted in www.someurl.com).
PS: I have already created a site using firebase and firestore as backend.
https://t-heros.web.app/
Thanks in advance.
One thing is you need to keep your local machine 24*7 for your app to work throughout the day. And for your answer you can expose your localhost to public domain by using static IP address and routing applicable from your router with appropriate firewall rules, all this also requires effort and maybe static IP address requires purchase. With both these together your React app can access the localhost on your machine for operations.

set cookie on a react app running on different port from express api server running on different port on same machine but not on localhost

I am running both the react app on 0.0.0.0:5000 and expressjs api server on 0.0.0.0:3000 .i.e. instead of accessing them via localhost I am using my machines ip on home network which is
192.168.0.7:5000 (for react app)
192.168.0.7:3000 (for api server)
I have to test this on different devices connected to my home wifi. However the app is unable to allow set cookie
this set cookie was blocked because its domain attribute was invalid with regards to the current host url
as per suggestions over net added proxy to package.json of react app
and in changed cookie domain in api server setting to 192.168.0.7:5000 (address for react app)
below is the screenshot of the network request in chrome

Deploy nodejs express on AWS windows server

I deplyoed my nodejs application on a AWS server with windows server as OS. The application is a simple express server running on https port 443. The application is accessible through localhost, but I can access the app through public IP.
Here are a few things I tried:
IIS with urlrewrite like so (https://dev.to/massivebrains/deploying-node-express-app-on-a-windows-server-2l5c)
iisnode
I am still not able to access my app. I setup up inbound rules in my firewall for the port and nodejs itself.
The issue was simply in my security group. I had set up the IP addresses I was expecting, but one was missing. It is working now.

Resources