0

So- I have some python scripts running permanently on my VPS and I want to be able to send them data to chew on via a simple web interface.

I do not mind how it gets the data. It seems to me that the simplest is probably to write the data to a file, and the python script automatically reads from this file every X seconds for changes. Then the solution need not involve python in any way.

From reading elsewhere, I believe the simplest solution is a simple php script. The problem here is that I'm running a pm2 server on the VPS. Pm2 does not support php I believe- and I can't install LAMP as this would presumably interfere with pm2.

I've looked into trying to do this with JS but that saves files client side and I need it server side.

I've also looked into cgi (I have zero experience with this) but pm2 doesn't seem to support this either?

Is there some fancy solution using node js?

What is the best way to tackle this problem!?

mcplums
  • 159
  • 2
  • 2
  • 9
  • You could write the data to a file on your server using Node. Search for file operations using node and you'll get it. – Prerak Sola Jan 23 '19 at 16:18
  • you can use `fs` to write file in your server side, in node.js app, follow this https://stackoverflow.com/questions/2496710/writing-files-in-node-js – Saikat Chakrabortty Jan 24 '19 at 05:45

0 Answers0