I'm a newbie web developer, and my company wants me to create a little application that when a user presses a button in a web browser, it runs a script on our server and tells the user how many hours they've used within the browser window.
So far I have a Node.JS script that runs a perl script on the server, but my problem comes from getting the javascript in the browser to run that Node.JS script. All the tutorials I've found have shown me how to make a Node.JS server using Express, but I can only access it through localhost. How can I access it from the browser?
So far I've tried connecting to the IP of my computer, and going to the port my Node.JS server is listening on, but no luck. I've also tried having the Node.JS server act as the webpage, but that also got me no where.
Can anyone help bridge the gap between the two for me? or if my logic is wrong, point me to a good resource that might help sort things out?
Sorry Brian But I think you are confusing the concepts, because localhost you can access it from the browser without problem, just type localhost:3000 in you webbrowser and you will be there (suppousing that 3000 is the port you are listening to in your node app)
If you are referring to have node in a webserver, there are many alternatives, like openshift or heroku.
If you refer to call some action in your backend from the frontend, just send a method from the frontend, like get or post, and then have your backend treat that accordingly
EDIT---------------
Something i didnt said but maybe is causing you this, is that you should run your node app in a terminal before you could access it, something like node server.js