Skip to content

Commit

Permalink
Merge pull request #1146 from schfork/docs/phoenix
Browse files Browse the repository at this point in the history
docs(phoenix): connect to unix socket instead of tcp
  • Loading branch information
domenkozar committed Apr 18, 2024
2 parents e316837 + ab9f56d commit d775275
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/phoenix/.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ex

pushd hello
wait_for_port 4000
wait_for_port 4000 60
mix ecto.create
curl -s http://localhost:4000/ | grep "Phoenix Framework"
popd
4 changes: 3 additions & 1 deletion examples/phoenix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ $ devenv shell
$ mix local.hex --force
$ mix local.rebar --force
$ mix archive.install hex phx_new
$ mix phx.new hello
$ mix phx.new --install hello
$ sed -i.bak -e "s/hostname: \"localhost\"/socket_dir: System.get_env(\"PGHOST\")/" \
./hello/config/dev.exs && rm ./hello/config/dev.exs.bak
$ devenv up
$ cd hello && mix ecto.create
```
14 changes: 10 additions & 4 deletions examples/phoenix/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@
processes.phoenix.exec = "cd hello && mix phx.server";

enterShell = ''
mix local.hex --force
mix local.rebar --force
mix archive.install --force hex phx_new
if [ ! -d "hello" ]; then
mix local.hex --force
mix local.rebar --force
mix archive.install --force hex phx_new
mix phx.new --install hello
# guard against multiple invocation of "enterShell"
mkdir hello
echo y | mix phx.new --install hello
sed -i.bak -e "s/hostname: \"localhost\"/socket_dir: System.get_env(\"PGHOST\")/" \
./hello/config/dev.exs && rm ./hello/config/dev.exs.bak
fi
'';
}

0 comments on commit d775275

Please sign in to comment.