TianliJin / cowboy-examples

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

Home Page:http://robertmeta.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

http://robertmeta.com


Languages

Language:Erlang 95.8%Language:Batchfile 2.5%Language:Makefile 1.2%Language:Shell 0.6%