Skip to content

Phoenix framework components running over Elli server via Pastelli Plug adapter

Notifications You must be signed in to change notification settings

zampino/phoenix-on-pastelli

Repository files navigation

Simple Chat Example

Built with the Phoenix Framework

This is a fork of Chris McCord's Phoenix Chat Example running on top of Elli Server through Pastelli and Pastelli.Phoenix (README for more details).

Configuration

use Mix.Config

# Configures the endpoint
# and the handler
config :chat, Chat.Endpoint,
  url: [host: "localhost"],
  handler: Pastelli.Phoenix,
  # ...

Endpoint

defmodule Chat.Endpoint do
  use Pastelli.Phoenix.Endpoint
  use Phoenix.Endpoint, otp_app: :chat

  plug Pastelli.Phoenix.SocketDispatchRouter

  socket "/socket", Chat.UserSocket

  if code_reloading? do
    socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
    plug Phoenix.CodeReloader
    plug Phoenix.LiveReloader
  end

  ...

  plug Plug.Session,
    store: :cookie,
    key: "_chat_key",
    signing_salt: "LH6XmqGb",
    encryption_salt: "CIPZg4Qo"

  plug Chat.Router
end

About

Phoenix framework components running over Elli server via Pastelli Plug adapter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published