I developed a website using react and node.js, and my team deploy it on the server, the problem is when we try to use the website using the new domain or IP address it gives us this error:
Although it works fine in the localhost:3000 in the server, can you please give me the hints to solve this
I also faced the same issue because of not updating
backend URL so make sure to check the backend URL in the frontend. If you host any cloud-like Heroku then include on .env
In your case, there might be some other reason as well.
Related
I developed a simple web site using HTML and TypeScript and ran the web server using Parcel.
npx parcel index.html
Now it looks okay in the terminal.
But I can connect on the browser.
I was able to connect localhost:3000 when I worked on Next.js app before but now I can't even connect to this app's server as well as Parcel's server localhost:1234 .
I guess there happens common tricky issues related to localhost.
Please let me know what I should do to figure out this.
I've already followed this link but nothing was figured out...
Also I tried on not only Google Chrome but also Mozilla Firefox and IE but there were same issues..
I'm developing a web app using Next.js that is, in the end, served by a custom Express.js server. I'm trying to deploy this app on EC2 and access it but I'm getting ERR_CONNECTION_REFUSED errors.
I'm accessing the app over HTTP using the public DNS of my instance (http://ec2-PUBLIC_IPV4_ADDRESS.compute-1.amazonaws.com/) which works fine, the index.html then needs to load other files (e.g.: .js or .css files), but tried to load them over HTTPS (https://ec2-PUBLIC_IPV4_ADDRESS.compute-1.amazonaws.com/style.css). In the network tab of the developer tool of Chrome, I get one request that is succesful and other assets that fail with net::ERR_CONNECTION_REFUSED.
I was wondering if there is a config either on my EC2 instance, on my Express server or even on Next.js that needs to be modified to make sure that the connection is not upgraded to HTTPS.
I would prefer to find a solution that doesn't involve setting up a domain for early testing purposes.
Thanks in advance.
We are building a project with NuxtJS. The API is deployed on AWS and used Cloudflare to set up DNS.
Sending the request to asyncData(), inside this method we made the call to API via domain(the domain pointed to actual load balancer URL of AWS - by setting up CNAME in Cloudflare). The error 503 was returned. Looks like the call is occurring inside of nodejs server. If anyone was familiar with this situation, please give me a hand. Thanks in advance.
Also noticed that, this is not appearing when calling the API with nuxtjs from the browser. As I understand, nuxtjs's asyncData is executed from the server, while on navigation it executed from browser.
I am using nodeJS and expressJS for backend and ReactJS for frontend of my application. Everything works fine when run locally on my computer. However, I recently have tried to deploy the app using Heroku. The app successfully launches at the given link from Heroku but then whenever I try to sign in/sign up I'm always thrown an error from the backend. The error is as follows when I am using Safari and Google Chrome respectively:
I have already enabled cors on my expressJS server, what is the likely cause of the issue?
It looks like your ReactJS code has the url http://localhost:5000/ hard coded in it somewhere. If your same Heroku instance serves the ReactJS and provides your API endpoints, then you should consider using
/api/users/signup
for the URL of your API endpoint instead of
http://localhost:5000/api/users/signup
This wrong URL shows up as an access control issue because browsers block external pages served by https to use localhost APIs. Because cybercreeps.
I am getting a Network Error while calling my server(nodejs) API.
I have rechecked my localhost, server, and port.
They are all working fine. I have also confirmed using POSTMAN and also ran the server on the web locally to fetch data.
I think I have also added the cors properly in my server.js file.
Want some help on this.
I have also tried with dummy API and they worked fine.
My imports from front-end
Here is LogCat
Response Header in Postman
ngrok status
Hi I think you can try exposing your local host to the internet using a service like ngrok which will generate a url for you, and then try using the url to send requests instead of localhost:3000. Simply download and follow the instructions here: https://ngrok.com/docs
It seems that you are having a problem in react native code, not in backend. That's why you are not getting any error in postman.
I am guessing that you are importing the dependencies is problematic way.
if you are trying to use local server API in mobile application development, all you need to do is replace "localhost" in the URL with your pc IP address. This worked for me.