You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
I am working on a GPS tracking system and have used node js module available for gps tracking. i would like to understand how i can call method from my web interface developed in Php to the node.js server so that the node.js server can further send the command to the GPS device on tcp .
Denard Springle
unread,
Mar 20, 2016, 12:11:12 AM3/20/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nodejs
Lots of different ways...
expose an API using Node.js for your PHP web app to call (e.g. build a REST API around the GPS module)
if node and PHP are on the same physical server, and it is a low use (e.g. under 20 concurrent users) system, you could write a file in PHP and have Node look (directory watch) for that file to read and execute whatever commands are in the file.
you could use a 3rd party cache, like ehCache, to store commands from PHP and read (poll for) them from Node.
you could also do that with a database (store record in PHP, read (poll for) the record in Node.
Ditch PHP altogether and build the webapp in Node.
That's just 4 off the top of my head :) If it were me, I'd build a REST API in Node and call it from PHP - it's the cleanest of the solutions if you're tied to PHP for your webapp. Otherwise, just write the webapp in Node as well.
HTH!
-- Denny
Kevin "Ingwie Phoenix" Ingwersen
unread,
Mar 20, 2016, 1:20:25 AM3/20/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nod...@googlegroups.com
Or use hprose. An RPC protocol that can communicate between Node and PHP. I use it in my own project to forward unhandled HTTP traffic from node to PHP to run a traditional Laravel app.