Simple webservers in Elixir - a webserver that responds in a specific port without having to create a entire phoenix app?

Hey everyone,

Coming from other languages such as php, go and javascript(node) they all have simple ways to generate a web server. Node does not need a entire framework such as adonisJS or next, a simple lib such as express can do the trick, php has its on embeded webserver and go has also a http lib. I’m new to elixir and I’d like to know if it has such ‘‘simple’’ ways to create a webserver that responds in a specific port without having to create a entire phoenix app.

1 Like

As explained in this awesome article, Phoenix is actually very modular and works as a set of libraries playing well together but that can be used independently.

The webserver part is handled by Plug which is probably what you are looking for. There is an hello world example in the doc which is fairly compact. To be more precise, Plug defines a common interface for webservers, the more popular one is plug_cowboy which is wrapping the Erlang cowboy webserver.

5 Likes