How do I access a node.js server from the command line

Background to this problem:

I am using FFmpeg to convert videos – it is working fine. I am sending the FFmpeg requests to the command line using exec() in PHP. I am also using node.js and socket.io to deliver real time updates to my users- this is also working fine. I would like to be able to send a real time alert when the video has completed its conversion.

My question is:

How do I send a request from the command line to my node server. Can I run a JS file from the command line? If not what is the best way round it?

Thank you for your advice,

Chris.

I would go for curl. Trigger node with curl.

Something like:

curl localhost:3000/encodingCompleted?user=abc&[email protected]

And now node knows “completed” and can send a realtime update back to the user.

Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » How do I access a node.js server from the command line

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录