Trying to make a post request from nodejs to php server - javascript

I just uploaded my nodejs app on Heroku which makes a post request on my localhost 127.0.0.1 my localhost server is on PHP which takes a file and some data and generates an invoice but the problem is I get this error in the Heroku log when my deployed node server tries to make a post request to my PHP server using Axios.
enter image description here
You can see there is a message This is an error ignore that because I concatenated that with the error.
I would appreciate any help thanks.:)

Related

Check Server Load of Another Server

I have 2 servers on one server NodeJS is running and in another MySQL.
From NodeJS server, I can check the load average of NodeJS server by os.loadavg().
How can I check the load average of MySQL server from NodeJS server?

Firebase Cloud Messaging receive notifications on ruby on rails app

I am having an issue with fcm frontend(JS) part of application. I have implemented the JS code of getting a token from server but unable to receive a notification on my client.
I have my rails project setup and it is running using RPUSH. Rpush script is started as well. I am using CURL to send a push notification. I get success message as CURL response but it is not being received on my end. I have tried serviceworker-rails gem as well.
Service worker is started and I am able to receive token via JS request to fcm.

Heroku app served as HTTP with node.js

I have deployed a web application in Heroku using node.js but within the application I need to make a request to an HTTP endpoint that returns a JSON file. While making the request, I get the a Mixed content error. I understand this happens because my application has been served through HTTPS but the request is HTTP. How could I tell heroku to serve my application as HTTP or what should I do to make it HTTP? Will this solve the problem?

Meteor not being able to connect to prerender.io server

I have set up a prerender server on my local machine.
It is on port 3033 and it seems to display a rendered version of my meteor site when I type this in
curl http://localhost:3033/http://localhost:3000/?_escaped_fragment_=
Knowing that my prerender site works, I'm trying to set it up so that if I go to
curl http://localhost:3000/?_escaped_fragment_=
it should give me my Meteor site.
I'm using this package (https://github.com/dfischer/meteor-prerenderio) and I've got this line in my settings.json file
"PrerenderIO": {
"prerenderServiceUrl": "http://localhost:3033/"
}
However, when I run
curl http://localhost:3000/?_escaped_fragment_=
it returns nothing and I'm getting this message shown up on my meteor server log
res.send(status, body): Use res.status(status).send(body) instead
and it doesn't seem to be hitting the prerender server.
What is this message and why aren't I able to hit the prerender server?

404 GET in socket.io server in a Django template

I'm trying to work with Socket.io and Django in a project and when I load the socket.io script from the server
<script src="localhost:3000/socket.io/socket.io.js"></script>
<script>
var socket = io();
</script>
I get an error because my Django project is in localhost:8000 so I dont know why the socket.io script is trying to do requests from Django when I said that the socket.io server is in port 3000.
In js console in my browser says
GET http://localhost:8000/socket.io/EIO=3&transport=polling&t=142197415699051
404 (NOT FOUND)
and that should be looking to loacalhost:3000 and not to localhost:8000
My Django log console says:
[22/Jan/2015 18:50:23] "GET
/socket.io/?EIO=3&transport=polling&t=1421974222989-62 HTTP/1.1" 404
7506
Obvously because theres not a Django url to answer that request.
How can I load a socket.io server in a Django template???
You can't specify what port a server-side application listens to from a client-side script src attribute.
You have to configure what port socket.io uses on the server-side.
See this StackOverflow for an answer on how to do that.

Categories

Resources