Itty is a tiny webserver, written in Erlang, for the purposes of learning Erlang.
The code is not very pretty, but it is an attempt to learning how a webserver works while teaching myself Erlang. My hope is to someday have a somewhat complete (robust, all the expected features, minimal bugs, and concise) version of itty to use as a tool to teach others Erlang. As itty is improved and debugged I hope to publish more articles highlighting the challenges encountered and the techniques used to help others learn along the way.
Currently, itty will serve several types of files (see src/mime.erl) from a static directory. In the near future I hope to add directory browsing as well as simple, dynamic templates. Itty was mainly developed on Ubuntu Linux, I hope to add/verify other Linux platforms as well as Windows.
What you will need
- Clone from github.com
- “git clone git://github.com/zpeters/itty.git”
- Current as of writing is tree:
- Edit ‘application.cfg”
- Set the port (above 1024 if you aren’t running as root)
- Set the “docroot”, absolute path with no trailing slash
- Set the “http_logfile” and “event_logfile”
- Make sure ‘index.html’ exists in your docroot (itty doesn’t do directory browsing yet)
- “make run”
If all is well (and debugging is on) you will see a quick display of the current config
and should be able to see the webserver on the appropriate port
That’s about it.
For now development continues (you can see my todo list in Readme.org). If you enjoy Erlang, whether your a seasoned professional or just learning as a hobby, I greatly welcome your feedback. If you wish to contribute to itty itself patches can be emailed to me directly, or you can send me a pull-request on github.