Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(phoenix): connect to unix socket instead of tcp #1146

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
'';
}
Loading