Written by

Ever since always­data’s incep­tion – more than 10 years ago! –  it’s been pos­si­ble to run web appli­ca­tions using three major lan­guages: PHP, Python, and Ruby. While PHP has been a heavy­weight for a long time, Python and Ruby were, back then, the new kids on the block in the web world, and we were among the very first hosts to run appli­ca­tions writ­ten in those languages.

Today, PHP is still a heavy­weight, Python and Ruby have matured, and the new kids on the block have mul­ti­plied: Node.js, Go, Lua, Elixir, Haskell, Clojure, etc. Even though inter­preters and com­pil­ers were already installed on our servers and it was pos­si­ble to use them, for exam­ple, in SSH, it was not pos­si­ble to run appli­ca­tions that had been devel­oped in those lan­guages on the web… up until now!

A new type of web­site is crop­ping up: User pro­gram. When mak­ing a web­site of this type, you have to spec­i­fy a com­mand to be exe­cut­ed and that will start an HTTP serv­er. This pro­gram can be writ­ten in the lan­guage of your choice, inter­pret­ed, or com­piled: if the com­mand works cor­rect­ly (you can try it out it in SSH), your appli­ca­tion will be reachable.

An example with Node.js

Let’s use the exam­ple of a Hello World being imple­ment­ed in Node.js. Create a ~/www/app.js file that contains:

The pro­gram will lis­ten in on the IP and port 8100: these are not ran­dom val­ues, you will have to use the ones being spec­i­fied when you cre­ate your web­site, in always­data’s admin­is­tra­tion. Then, insert the fol­low­ing com­mand into the web­site cre­ation form:

node ~/www/hello.js

That’s it: our Node.js is reach­able and has some hand­some Hello World on it.

Discovery planning

Can’t wait to try out an appli­ca­tion writ­ten in your favorite lan­guage? Go ahead, and don’t hes­i­tate to con­tact our sup­port if you need any help (or to leave a com­ment on this arti­cle to express your joy). If your inspi­ra­tion is lack­ing, we’re going to be start­ing a series of arti­cles on this blog about get­ting start­ed with host­ing appli­ca­tions in dif­fer­ent languages.

First up: Node.js, and there’s even a sur­prise (Node.js’s devel­op­ers have been solic­it­ing us for so long, they’ve cer­tain­ly deserved it)…