summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Every <devstopfix@gmail.com>2020-03-26 15:04:54 +0000
committerJames Every <devstopfix@gmail.com>2020-03-26 15:04:54 +0000
commit86802163b4886a024ecff4c9bc762f17e701b87d (patch)
treea7e6c1944658aed391e75efc205f97f31c1fba0c
parentFix race condition in test (diff)
Docs for Phoenix controller [ci skip]
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 02faa19..c4a1ebb 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,17 @@ For a one shot test, use the helper method:
]}
```
+### Check uploaded files in a Phoenix controller
+
+You can inspect the file from your controller:
+
+```elixir
+def upload(conn, %{"upload" => %{path: path}}) do
+ {:ok, [mime_type: _, encoding: _, content: content]} = GenMagic.ApprenticeServer.file(:gen_magic, path)
+ text(conn, "Received your file containing #{content}")
+end
+```
+
## Soak test
Run an endless cycle to prove that the GenServer is resilient: