Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v
on the command line.
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
cat > Dockerfile <<'DOCKERFILE' | |
FROM yugabytedb/yugabyte:latest | |
ADD start.sh . | |
RUN chmod a+x start.sh | |
ENV RF=3 | |
CMD ./start.sh | |
DOCKERFILE | |
cat > start.sh <<'START' |
config :wps, WPSWeb.Endpoint, | |
live_reload: [ | |
notify: [ | |
live_view: [ | |
~r"lib/wps_web/core_components.ex$", | |
~r"lib/wps_web/(live|components)/.*(ex|heex)$" | |
] | |
], | |
patterns: [ | |
~r"priv/static/(?!uploads/).*(js|css|png|jpeg|jpg|gif|svg)$", |
Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.
This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.
The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.
To grab the new archive, simply run:
If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8
To use the new phx.new
project generator, you can install the archive with the following command:
$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs
:
#!/bin/bash | |
# installing erlang on ubuntu's | |
VERSION="R15B01" | |
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev | |
sudo mkdir -p /opt/erlang/ | |
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl | |
sudo mv kerl /opt/erlang/ |
defmodule DrainStop do | |
@moduledoc """ | |
DrainStop Attempts to gracefully shutdown an endpoint when a normal shutdown | |
occurs. It first shuts down the acceptor, ensuring that no new requests can be | |
made. It then waits for all pending requests to complete. If the timeout | |
expires before this happens, it stops waiting, allowing the supervision tree | |
to continue its shutdown order. | |
DrainStop should be installed in your supervision tree *after* the | |
EndPoint it is going to drain stop. |
// 1. Add Bootstrap as a dependency in package.json | |
{ | |
... | |
"dependencies": { | |
... | |
"bootstrap": "~3.3.6" | |
} | |
} |
# in your app supervisor | |
:phx_dyn_dispatch = :ets.new(:phx_dyn_dispatch, [:named_table, :bag, :public]) | |
defmodule DynamicDispatch do | |
def register(group, plug, opts) do | |
true = :ets.insert(:phx_dyn_dispatch, {group, plug, opts}) | |
end | |
def unregister(group, plug) do |