summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/privacy_revolver.ex18
-rw-r--r--lib/privacy_revolver/application.ex15
-rw-r--r--lib/privacy_revolver/router.ex10
3 files changed, 43 insertions, 0 deletions
diff --git a/lib/privacy_revolver.ex b/lib/privacy_revolver.ex
new file mode 100644
index 0000000..5de8e06
--- /dev/null
+++ b/lib/privacy_revolver.ex
@@ -0,0 +1,18 @@
+defmodule PrivacyRevolver do
+ @moduledoc """
+ Documentation for `PrivacyRevolver`.
+ """
+
+ @doc """
+ Hello world.
+
+ ## Examples
+
+ iex> PrivacyRevolver.hello()
+ :world
+
+ """
+ def hello do
+ :world
+ end
+end
diff --git a/lib/privacy_revolver/application.ex b/lib/privacy_revolver/application.ex
new file mode 100644
index 0000000..de38e6e
--- /dev/null
+++ b/lib/privacy_revolver/application.ex
@@ -0,0 +1,15 @@
+defmodule PrivacyRevolver.Application do
+ @moduledoc false
+
+ use Application
+
+ @impl true
+ def start(_type, _args) do
+ children = [
+ Plug.Cowboy.child_spec(scheme: :http, plug: PrivacyRevolver.Router, options: [port: 4001])
+ ]
+
+ opts = [strategy: :one_for_one, name: PrivacyRevolver.Supervisor]
+ Supervisor.start_link(children, opts)
+ end
+end
diff --git a/lib/privacy_revolver/router.ex b/lib/privacy_revolver/router.ex
new file mode 100644
index 0000000..cf702fe
--- /dev/null
+++ b/lib/privacy_revolver/router.ex
@@ -0,0 +1,10 @@
+defmodule PrivacyRevolver.Router do
+ use Plug.Router
+
+ plug :match
+ plug :dispatch
+
+ get "/ping" do
+ send_resp(conn, 200, "pong")
+ end
+end