Datatable ajax failed with net::ERR_CONNECTION_REFUSED - node.js

In my application that:
1- frontend react app served via node on (localhost:3000)
2- backend laravel server on (localhost:8000)
ajax failed with error in console-network tab :
GET https://localhost:8000/api/v1/testApis net::ERR_CONNECTION_REFUSED
How can i fix this issue ?

Related

Get error 503 on node js server on shared host

Get error 503 from post ajax request on node js express on shared host but work fine on local server
i try checking the url call on the ajax request

Cant connect azureweb app to node server, resulting in net::ERR_CONNECTION_REFUSED

I am using node.js and react and have deployed to the azure app service,
the startup command is pm2 serve /home/site/wwwroot --no-daemon --spa which works
However when I visit the website and visit a page that needs to load images from a database or perform any http requests, the app can't connect to the node.js server and I get the error:
https://boobah.azurewebsites.net:8080/requests/therapists net::ERR_CONNECTION_TIMED_OUT
The call I make in my code to load the data to the page is this:
await axios.get('https://boobah.azurewebsites.net:8080/requests/therapists')
which works locally just by changing the domain to localhost and on port 3000.
Can anyone please help me for why this is not loading any data to the deployed azure app ?
Thanks you

Unable to redirect the URL to another page in docker app

Summarize of my problem:
I have create a website using MERN stack and deployed to AWS using docker.
when I refresh the domain page i.e http://discussion.sramanujan.com/ ,it works fine.
When I directly try to access the discussion url http://discussion.sramanujan.com/discussion , I get "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"
Steps to repro the issue:
lauch the website http://discussion.sramanujan.com/
Refresh the browser [website should reload successfully]
Click on discussion button. [website url will change to http://discussion.sramanujan.com/discussion ]
Refresh the page.
Expected:
Page should load discussion page on refresh
Actual:
Got an error message as "Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
Any idea as how to handle this issue?
More information:
1.host server port 80 is mapped to docker container port 3000.
2.Navigation through website is working fine.
/usr/src/api is my WORKDIR
Logs from server:(on refresh I get error 500)
you are also getting a 304 (Not modified) error on your website, try to enable javaScript, after that it should work

How to Connect Jhipster Front-End with Back-End in different server

CLOSED
Im use proxy_pass nginx.
I have 2 different servers, 1 server I install a jhipster frontend and 1 server I install a jhipster back-end.
how do I connect the jhipster frontend with the back-end.
Because every time I enter the front-end page at localhost:9000, I always redirect to the page localhost:8080/login. an error appears "The site can't be reach".
dev setup:
Back-End, using docker-compose
authentication is AUTH 2.0 using keycloak : 192.168.99.177:9080
jhipster-register : 192.168.99.177:8761
postgres : 192.168.99.177:5432
Front-End, using npm start
angular 7 : localhost:9000
please help me, which part of the configuration should I change.
thank you
Set SERVER_API_URL constant in webpack.common.js
In your case it would look like this:
SERVER_API_URL: `'https://192.168.99.177:8761/'`

Express server unable to proxy to my React project

I have an issue, my server is giving me an error that it is unable to proxy from localhost:8080 to localhost:3000 on my local machine, it also showed a Http parse error together.
I am trying to run a React and Express project and it worked when I used cloud9 to run it.

Resources