Process js files like php, on the server side

Hi Everyone,

I was wondering How can process JS files on the server side just like normally I would use php files. For example:

I put some data in the inputs on the website and I press submit button and instead of sending those data to php file I would like to send it to JS file.

Simple example I put 2 and 4 on the website ,next press submit button sending it (2 and 4) to JS file

Here I make an operation 2*4 and again sending result to to website.

All should be done in one JS file (if possible).

DO I need node or some other frameworks to do this ?

Regards,

Node runs JavaScript, it’s a [server-side] runtime that allows JS to be executed outside of the browser. I would look at the backend section on FCC, that teaches Node.