0

Most of my website is PHP, and I want to start making a little better UI with live push notifications. I read a few articles and posts here as well, but non provide concrete examples. It's really hard to learn by yourself especially when Node still has no tutorials in abundance, mostly beginner's tutorials. Let's say I have a PHP page: post.php which allow user to enter a post, and I use PDO to insert that post to the MySQL db. What is the simple way to connect a node.js (on a different port) and listen to that PHP page, to then in turn show a notification on the navbar, for example? I know I will need to use socket.io as well.

pileup
  • 1
  • 2
  • 18
  • 45
  • You can do one thing here is that create a route for live-notification in `node.js`, and send a `curl` request to that URL wherever you have to send notification. – Sonu Bamniya May 14 '18 at 05:35
  • Use below link for details on integrating PHP and node.js https://stackoverflow.com/questions/17209717/how-to-integrate-nodejs-socket-io-and-php – Rohith Pavithran May 14 '18 at 07:22
  • Have you looked into https://github.com/web-push-libs/web-push-php ? – John Joseph May 14 '18 at 08:28

0 Answers0