# Phoenix
> Realtime Elixir Web Framework

## Goals
- First class websockets
- Ring distribution

```elixir
defmodule Router do
  use Phoenix.Router, port: 4000

  get "pages/:page", PagesController, :show, as: :page
  get "files/*path", FilesController, :show
  resources "users", UsersController
end

defmodule PagesController do
  use Phoenix.Controller

  def show(conn) do
    text conn, "Hello! #{conn.params["page"]}"
  end
end

defmodule UsersController do
  use Phoenix.Controller

  def show(conn) do
    text conn, "Showing user #{conn.params["id"]}"
  end

  def index(conn) do
    html conn, """
    <html>
      <body>
        <h1>Users</h1>
      </body>
    </html>
    """
  end
end
```

## Starting the application

```bash
$ mix run -e 'Router.start' --no-halt mix.exs
```


# Phoenix
> Realtime Elixir Web Framework

## Goals
- First class websockets
- Ring distribution

```elixir
defmodule Router do
  use Phoenix.Router, port: 4000

  get "pages/:page", PagesController, :show, as: :page
  get "files/*path", FilesController, :show
  get "profiles/user-:id", UsersController, :show
  resources "users", UsersController
end

defmodule PagesController do
  use Phoenix.Controller

  def show(conn) do
    text conn, "Hello! #{conn.params["page"]}"
  end
end

defmodule UsersController do
  use Phoenix.Controller

  def show(conn) do
    text conn, "Showing user #{conn.params["id"]}"
  end

  def index(conn) do
    html conn, """
    <html>
      <body>
        <h1>Users</h1>
      </body>
    </html>
    """
  end
end
```

## Starting the application

```bash
$ mix run -e 'Router.start' --no-halt mix.exs
```


Add hyper route match example.
Add hyper route match example.
