Page 1 of 1

JavaScript and Node.js

PostPosted: Thu Mar 16, 2017 12:48 am
by TMcD
So, I've only used JavaScript that someone has provided for me, but I'm starting to learn it (not to difficult to start)...

Since we can use JavaScript to do many things, it's really like Node.js, right? Meaning that it can be used to do stuff other than browser stuff.

If my thinking is right, how can we connect twilio to NeoBook, to send SMS messages?

https://www.twilio.com/blog/2016/04/send-text-in-javascript-node-in-30-seconds.html

Re: JavaScript and Node.js

PostPosted: Thu Mar 16, 2017 5:21 am
by Gaev
TMcD:

So, I've only used JavaScript that someone has provided for me, but I'm starting to learn it (not to difficult to start)...
Since we can use JavaScript to do many things, it's really like Node.js, right? Meaning that it can be used to do stuff other than browser stuff.

Node.js is a server side platform that can interpret/service commands written in Javascript. While Javascript is easy (at least the basic and intermediate stuff), Node.js is not for the faint of heart.

In my opinion, it is unnecessarily complicated (and getting worse by the year) ... made by gurus ... for use by other gurus ... sacrifices ease of use for shortcut methods of coding ... even people familiar with PHP etc. have difficulty getting their headsaround the pecularities of Node.js ... too bad, because it is the only Javascript platform on the server side.

Installing Node.js on a Windows machine is also a pain.

If my thinking is right, how can we connect twilio to NeoBook, to send SMS messages?
https://www.twilio.com/blog/2016/04/sen ... conds.html

Those instructions are for use on a server ... notice the command ...
Code: Select all
// Find your account sid and auth token in your Twilio account Console.
var client = twilio('TWILIO_ACCOUNT_SID', 'TWILIO_AUTH_TOKEN');

... defines your account name/password ... if you expose this on the client side, anyone can then use it outside your application ... and you would be charged for that use !!!

Re: JavaScript and Node.js

PostPosted: Fri Mar 17, 2017 12:58 pm
by TMcD
Thanks Gaev,

I didn't know that Node.js was only server side. I thought it could be run locally as well.

Re: JavaScript and Node.js

PostPosted: Fri Mar 17, 2017 2:13 pm
by Gaev
TMcD:

I thought it could be run locally as well.

It can be run on your local machine ... but you have to set it up as a server (not a simple process as it was designed with the Linux OS in mind) ... same as you can run PHP or Ruby on your windows machine if you first install a local server (address http://127.0.0.1).

If you take a look at the Node (npm) installation instructions (for a Windows machine) e.g. here ... https://nodesource.com/blog/installing- ... l-windows/ ... you will see the level of technical difficulty.

Re: JavaScript and Node.js

PostPosted: Sat Mar 18, 2017 12:00 am
by HPW
Hello,

Offtopic: Ruby can be used locally by embedding the ruby-dll. ;-)

Regards