September 2013
Intermediate to advanced
548 pages
12h 25m
English
Cowboy is a small, fast, modular HTTP server written in Erlang and available from https://github.com/extend/cowboy. It is supported by a company called Nine Nines.[41]
Cowboy is suitable for building embedded applications. There are no configuration files, and it produces no logs. Everything is controlled from Erlang.
We’ll make a very simple web server that is started with the
command simple_web_server:start(Port). This starts a
web server listening for commands on Port and whose
root directory is the directory where the program was started.
The main function that starts everything is as follows:
| cowboy/simple_web_server.erl | |
| Line 1 | start(Port) -> |
| - | ok = application:start(crypto), |
| - | ok = application:start(ranch), ... |
Read now
Unlock full access