Tuesday 3 May 2016

Learning Node JS from a PHP background?

So I'm over on the openshift platform ( http://ift.tt/11iDe6x ) normally I'm 99% PHP focused but the new Microsoft bot API says use C# or Node JS. So I opted to let openshift do my hosting and use node. 5.6 was easy enough to install and npm. And... I can run things aside from the basic server they provide. Binding things to ports and IP's is a little different then what I'm used to with PHP (I mean the DB's are pretty easy to set ports and IPs for it's pretty much automatic)Where I'm confused is how to use something like this telegram bot (or other production code). Looking over the code it doesn't seem to bind to a port. So what do I tell telegram to set the webhook to? Is openshift a limiting factor in what I'm capable of, as far as PHP it's been the most open platform without doubt.I'm doing something wrong... normally I have a location like http://webhost/script.php but with node I've just got .js files that use a port and IP... sometimes a directory which is kinda strange to me. Perhaps I need to expose those .js files in some way or bind a directory for things to use?

Submitted May 04, 2016 at 03:26AM by edmazing

No comments:

Post a Comment