Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This project will clone all the misultin examples over to cowboy ones

branch: master
Octocat-spinner-32 apps Some cleanup March 23, 2012
Octocat-spinner-32 .gitignore Hello World Started February 25, 2012
Octocat-spinner-32 Makefile Hello World Started February 25, 2012
Octocat-spinner-32 README.md fixed broken link March 23, 2012
Octocat-spinner-32 rebar.config Some cleanup March 23, 2012
Octocat-spinner-32 startit Added in SSL example February 26, 2012
Octocat-spinner-32 startit.bat Some cleanup March 23, 2012
README.md

Quickstart

  • If you already have make, rebar and git in your path (even on windows)
    • make && ./startit
    • run whatever app you want by starting it -> helloworld:start()
    • check it out at http://localhost:8080
  • NOTE: Apps all run on :8080 (so must be run one by one)

What is this?

This is a simple project to show some examples of using the Erlang Cowboy "Small, fast, modular HTTP server and socket acceptor pool". The first order of business was to port all the amazing misultin examples over to cowboy. Part of my motivation for doing this was the misultin end of life.

What isn't this?

This isn't documentation, or intended as any sort of documentation replacement this is just a small set of working example you can run locally and quickly.

Too complicated?

I did my best to keep it simple while following the OTP structure. If you are un-familiar with OTP some of the examples might seem overly wordy. I am not going to worry too much about that and just label it "bonus learning"!

Each application was designed as an island able to be run completely seperate from the other applications (but obviously still has dependancies on cowboy).

Examples List

  • echo_get -> Dealing with querystring data
  • echo_post -> Dealing with posted data
  • hello_world -> Start here!
  • hello_world_chunked -> Shows serving a reply in chunks
  • hello_world_rest -> Show the RESTful upgrade / handler in Cowboy
  • hello_world_ssl -> Show the simpliest SSL app
  • redirect -> Show a basic redirect using a header
  • static -> Show the static handler in Cowboy

Links

TODO

  • Access Log -> Hard to do right now due to lack of a good place to hook
  • Comet
  • Compression -> Coming soon, but will be hand coded
  • Cookies
  • EventSource
  • File (binary save)
  • Multiple Servers (concurrently)
  • Sessions
  • Stream
  • Websocket
Something went wrong with that request. Please try again.