Get error 503 on node js server on shared host - node.js

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

Related

How to make my Ubuntu/Apache2 (Using Nodejs and Expressjs) server use the server's localhost instead of the user's localhost?

I'm new to Ubuntu and Apache.
When I CRUD through Express, instead of using the serverĀ“s localhost, server/browser will use my computer's localhost.
If I turn off Express server in localhost, the server's get, post and delete don't work, and I can't seem to find a way to use the server's localhost instead of my computer's.
I've also tried sending my requests to:
http://localhost:8383/decrypted
http://127.0.0.1:8383/decrypted
The routes above throw an error as they are http and server is https.
https://example.com/8383/decrypted
The route about throws error connection refused
https://example.com/8080/decrypted
I tried adding a virtualhost in 8080 and routing it through apache to 8383, but shows the same error as above, connection refused.
How can I make the server use its localhost instead of the user's localhost?

Datatable ajax failed with net::ERR_CONNECTION_REFUSED

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 ?

Why I get 404 error for some files when running the nodejs app on http server?

I get 404 error for some files when running the nodejs app on http server error message is like below
Error: Request failed with status code 405
at createError (createError.js:16)
at settle (settle.js:18)
And there was no error when running on localhost.
The error message reports an error 405, which means the web server refused your action. http://www.checkupdown.com/status/E405.html
ie: you sent a POST method but your server doesn't allow it.
Check your web server's configuration and fix it accordingly.

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.

Ionic - XMLHttpRequest cannot load

I have an Ionic PWA, so it runs in browser. I'm trying to send requests to my symfony backend. At first I had everything installed on my local pc and the requests were working with an ionic proxy. Now I have installed both applications on a server. At first I have tried to use the url from the backend without proxy. Then there was a CORS error. Then I wrote a .htaccess file for the backend with the following input:
Header add Access-Control-Allow-Origin "\*"
Header add Access-Control-Allow-Methods: "GET,POST,OPTIONS,DELETE,PUT"
Now I'm getting this:
XMLHttpRequest cannot load
... Response for preflight
has invalid HTTP status code 405
If I set a proxy as before on the local installation like this:
"proxies": [
{
"path": "/api",
"proxyUrl": "http://api.example.com/api"
}
]
I'm getting a 404 not found error, when I try to send a request to http://app.example.com/api
Can someone tell me how it will work correctly when frontend and backend are on a server and the app runs in the browser?
If you're getting a 405 back, that's a method not supported error, so it looks like you server isn't configured to handle OPTIONS requests. That's causing the pre-flight CORS request to get rejected.

Resources