Servy is a humble HTTP Server written in Elixir for the Pragmatic Studio's Elixir & OTP course.
Servy features
- Heavy use of pattern matching
- File and Socket IO
- Handling state with GenServer
- Using Supervisor to immediately recover from failures 🙌
- Handling requests in concurrent processes
A good entry point of the project would be checking the Handler module, that acts as a router for the requests. The server replies with JSON objects or HTML, depending on the endpoint that's matched on the router. Some routes to try:
- /pledges
- /sensors
- /404s holds the routes requested by the user but weren't found
- and more..
Supervisor supervises:
- ServicesSupervisor
- KickStarter
- supervises the non OTP process: HttpServer
ServicesSupervisor supervises:
If available in Hex, the package can be installed
by adding servy to your list of dependencies in mix.exs:
def deps do
[{:servy, "~> 0.1.0"}]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/servy.
> mix run --no-halt
or
> iex.bat -S mix