Dustin Hux Dustin Hux - 5 months ago 25
Node.js Question

How to publish a Node.js Server online so that it is always accessible by an outside application

I have searched everywhere for a solution to this problem but for whatever reason I cannot find a clear answer as to how I can carry out this task.

I have built a very simple server with node.js that accesses two numbers from a website API and outputs them onto a localhost port on my computer as shown below:

My question is how can I take my server and make it accessible to applications without having to go into the command line and run the server file? Is there a way I can host it online instead of locally so that I can distribute the application and anyone with the application can pull from this server? What would be the best way to go about accomplishing this task?

Answer

Heroku is probably one of the easiest ways to get started with deploying the application: https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction

However, if you are not familiar with git, Microsoft Azure Webapps is also another great option: https://tryappservice.azure.com/

They both offer free plans which should get you up and running fast!