I
I
iroge2019-11-09 18:14:41
PHP
iroge, 2019-11-09 18:14:41

How to pass data from php to node js?

On the local host, I am making a bot for parsing pages with the puppeteer connection. I implement parsing in php, analyze the page and get the necessary data by tags. So this data needs to be passed to the node js script, where the puppeteer module is connected. The script performs the necessary operations on the page according to the data received from php (it is not possible to perform operations without the browser mode). So the question is how to pass data to a node js script? I know that it is possible through curl to another port, but then the question is how to configure openserver (the client for the web server that I use) to send to the desired file on this port

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
mayton2019, 2019-11-09
@mayton2019

At first the topic started well. But it is not clear why the author refers to some files in the last line. It was an absolutely correct message. Integration between PHP and NodeJS is done through enpoints. The scheme is working.
Remove the notion of a file from the statement. And everything will work.

D
Daria Motorina, 2019-11-09
@glaphire

Is it just not suitable to write a rest endpoint in php and pull it on a node?

S
Somewhere Intech, 2019-11-09
@john36allTa

How to do this without sockets:
1. How to start a process from php
2. How to parse cli input parameters in a node.js script (quotes, don't forget about ")
If this scheme does not work, then you have hidden something)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question