Skip to content

Commit c49efa1

Browse files
committed
starting a project with raxx.kit
0 parents  commit c49efa1

23 files changed

+356
-0
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc
12+
13+
# If the VM crashes, it generates a dump, let's ignore it too.
14+
erl_crash.dump
15+
16+
# Also ignore archive artifacts (built via "mix archive.build").
17+
*.ez

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Watercooler
2+
3+
- Install dependencies with `mix deps.get`
4+
- Start your service with `iex -S mix`
5+
- Run project test suite with `mix test`
6+
7+
## Learn more
8+
9+
- Raxx documentation: https://hexdocs.pm/raxx
10+
- Slack channel: https://elixir-lang.slack.com/messages/C56H3TBH8/
11+
12+
## Building a distributed chatroom with Raxx.Kit
13+
14+
This is the code example for a distributed chatroom built with Raxx.Kit.
15+
The full discussion around building it can be found in [this blog post](http://crowdhailer.me/2018-05-01/building-a-distributed-chatroom-with-raxx-kit/).

config/config.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
use Mix.Config
2+
3+
config :exsync,
4+
extra_extensions: [".js", ".css"]

lib/watercooler.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
defmodule Watercooler do
2+
end

lib/watercooler/application.ex

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
defmodule Watercooler.Application do
2+
@moduledoc false
3+
4+
use Application
5+
6+
def start(_type, _args) do
7+
8+
config = %{}
9+
cleartext_options = [port: port, cleartext: true]
10+
secure_options = [port: secure_port, cleartext: :false, certfile: certificate_path(), keyfile: certificate_key_path()]
11+
12+
children = [
13+
Supervisor.child_spec({Watercooler.WWW, [config, cleartext_options]}, id: :www_cleartext),
14+
Supervisor.child_spec({Watercooler.WWW, [config, secure_options]}, id: :www_secure),
15+
16+
]
17+
18+
opts = [strategy: :one_for_one, name: Watercooler.Supervisor]
19+
Supervisor.start_link(children, opts)
20+
end
21+
22+
defp port() do
23+
with raw when is_binary(raw) <- System.get_env("PORT"), {port, ""} = Integer.parse(raw) do
24+
port
25+
else
26+
_ -> 8080
27+
end
28+
end
29+
30+
defp secure_port() do
31+
with raw when is_binary(raw) <- System.get_env("SECURE_PORT"), {secure_port, ""} = Integer.parse(raw) do
32+
secure_port
33+
else
34+
_ -> 8443
35+
end
36+
end
37+
38+
defp certificate_path() do
39+
Application.app_dir(:watercooler, "priv/localhost/certificate.pem")
40+
end
41+
42+
defp certificate_key_path() do
43+
Application.app_dir(:watercooler, "priv/localhost/certificate_key.pem")
44+
end
45+
end

lib/watercooler/public/favicon.ico

31.3 KB
Binary file not shown.

lib/watercooler/public/main.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* Reset */
2+
body {
3+
margin: 0;
4+
}
5+
6+
/* Make everything a border-box, because why not? */
7+
html {
8+
box-sizing: border-box;
9+
}
10+
*, *:before, *:after {
11+
box-sizing: inherit;
12+
}
13+
14+
html {
15+
min-height: 100%;
16+
}
17+
18+
body {
19+
font-family: 'Roboto', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
20+
font-size: 1.6em // Currently ems cause chrome bug misinterpreting rems on body element;
21+
font-weight: 300;
22+
letter-spacing: .01em;
23+
line-height: 1.6;
24+
color: white;
25+
26+
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#45484d+0,000000+100 */
27+
background: rgb(69,72,77); /* Old browsers */
28+
background: -moz-linear-gradient(right , rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%); /* FF3.6-15 */
29+
background: -webkit-linear-gradient(right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* Chrome10-25,Safari5.1-6 */
30+
background: linear-gradient(to left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
31+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#45484d', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
32+
33+
}
34+
35+
h1 {
36+
margin: 0;
37+
font-size: 6.6rem;
38+
font-weight: 300;
39+
line-height: 1.2;
40+
}
41+
42+
.centered {
43+
margin-left: auto;
44+
margin-right: auto;
45+
max-width: 80rem;
46+
}
47+
48+
.accent {
49+
border-left: #00ff9c 2px solid;
50+
margin: 50px;
51+
padding: 30px;
52+
}
53+
54+
nav {
55+
letter-spacing: 3.5em
56+
}
57+
nav a {
58+
color: #00ff9c;
59+
letter-spacing: 0.05em
60+
}

lib/watercooler/public/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hello")

lib/watercooler/www.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
defmodule Watercooler.WWW do
2+
use Ace.HTTP.Service, [port: 8080, cleartext: true]
3+
4+
use Raxx.Router, [
5+
{%{method: :GET, path: []}, Watercooler.WWW.HomePage},
6+
{_, Watercooler.WWW.NotFoundPage}
7+
]
8+
9+
@external_resource "lib/watercooler/public/main.css"
10+
@external_resource "lib/watercooler/public/main.js"
11+
use Raxx.Static, "./public"
12+
use Raxx.Logger, level: :info
13+
end

lib/watercooler/www/_layout.html.eex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>watercooler </title>
6+
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
7+
<link rel="stylesheet" href="/main.css">
8+
</head>
9+
<body>
10+
<%= content %>
11+
<script type="text/javascript" src="/main.js"> </script>
12+
</body>
13+
</html>

lib/watercooler/www/home_page.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
defmodule Watercooler.WWW.HomePage do
2+
use Raxx.Server
3+
use Watercooler.WWW.HTMLView
4+
5+
@impl Raxx.Server
6+
def handle_request(_request, _state) do
7+
response(:ok)
8+
|> render(%{})
9+
end
10+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<main class="centered">
2+
<section class="accent">
3+
<h1>Raxx.Kit</h1>
4+
<h2>Simply cloud native</h2>
5+
<nav>
6+
<a href="https://github.com/CrowdHailer/raxx">SOURCE CODE</a>
7+
<a href="https://elixir-lang.slack.com/messages/C56H3TBH8/">CHAT</a>
8+
</nav>
9+
</section>
10+
</main>

lib/watercooler/www/html_view.ex

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
defmodule Watercooler.WWW.HTMLView do
2+
layout_path = Path.join(__DIR__, "_layout.html.eex")
3+
4+
require EEx
5+
EEx.function_from_file(:def, :render_layout, layout_path, [:content, :assigns], engine: Phoenix.HTML.Engine)
6+
7+
defmacro __using__(_options) do
8+
quote do
9+
file_path = case String.split(__ENV__.file, ~r/\.ex(s)?$/) do
10+
[path_and_name, ""] ->
11+
path_and_name <> ".html.eex"
12+
_ ->
13+
raise "Needs to be an `.ex` file"
14+
end
15+
16+
require EEx
17+
EEx.function_from_file(:defp, :render_content, file_path, [:assigns], engine: Phoenix.HTML.Engine)
18+
19+
def render(response, assigns) do
20+
{:safe, io_list} = unquote(__MODULE__).render_layout(render_content(assigns), assigns)
21+
22+
response
23+
|> Raxx.set_header("content-type", "text/html")
24+
|> Raxx.set_body("#{io_list}")
25+
end
26+
end
27+
end
28+
end

lib/watercooler/www/not_found_page.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
defmodule Watercooler.WWW.NotFoundPage do
2+
use Raxx.Server
3+
use Watercooler.WWW.HTMLView
4+
5+
@impl Raxx.Server
6+
def handle_request(_request, _state) do
7+
response(:not_found)
8+
|> render(%{})
9+
end
10+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<main class="centered">
2+
<section class="accent">
3+
<h1>Nothing here!</h1>
4+
</section>
5+
</main>

mix.exs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
defmodule Watercooler.Mixfile do
2+
use Mix.Project
3+
4+
def project do
5+
[app: :watercooler,
6+
version: "0.1.0",
7+
elixir: "~> 1.6.4",
8+
build_embedded: Mix.env == :prod,
9+
start_permanent: Mix.env == :prod,
10+
deps: deps()]
11+
end
12+
13+
def application do
14+
[extra_applications: [:logger],
15+
mod: {Watercooler.Application, []}]
16+
end
17+
18+
defp deps do
19+
[
20+
{:ace, "~> 0.16.4"},
21+
{:phoenix_html, "~> 2.11"},
22+
{:raxx_static, "~> 0.6.1"},
23+
{:exsync, "~> 0.2.3", only: :dev},
24+
]
25+
end
26+
end

mix.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
%{
2+
"ace": {:hex, :ace, "0.16.4", "8e3fe95f4f5b32c094037610f648c059b2f9fafafe9a33662908ad5b6022f9ed", [:mix], [{:hpack, "~> 0.2.3", [hex: :hpack_erl, repo: "hexpm", optional: false]}, {:raxx, "~> 0.15.2", [hex: :raxx, repo: "hexpm", optional: false]}], "hexpm"},
3+
"cookie": {:hex, :cookie, "0.1.1", "89438362ee0f0ed400e9f076d617d630f82d682e3fbcf767072a46a6e1ed5781", [:mix], [], "hexpm"},
4+
"exsync": {:hex, :exsync, "0.2.3", "a1ac11b4bd3808706003dbe587902101fcc1387d9fc55e8b10972f13a563dd15", [:mix], [{:file_system, "~> 0.2", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm"},
5+
"file_system": {:hex, :file_system, "0.2.5", "a3060f063b116daf56c044c273f65202e36f75ec42e678dc10653056d3366054", [:mix], [], "hexpm"},
6+
"hpack": {:hex, :hpack_erl, "0.2.3", "17670f83ff984ae6cd74b1c456edde906d27ff013740ee4d9efaa4f1bf999633", [:rebar3], [], "hexpm"},
7+
"mime": {:hex, :mime, "1.2.0", "78adaa84832b3680de06f88f0997e3ead3b451a440d183d688085be2d709b534", [:mix], [], "hexpm"},
8+
"phoenix_html": {:hex, :phoenix_html, "2.11.2", "86ebd768258ba60a27f5578bec83095bdb93485d646fc4111db8844c316602d6", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"},
9+
"plug": {:hex, :plug, "1.5.1", "1ff35bdecfb616f1a2b1c935ab5e4c47303f866cb929d2a76f0541e553a58165", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.3", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"},
10+
"raxx": {:hex, :raxx, "0.15.4", "62e4a487e55e9469d1ba2d5de590672167f51eaac310f027f3f871018cb6a9fc", [:mix], [{:cookie, "~> 0.1.0", [hex: :cookie, repo: "hexpm", optional: false]}], "hexpm"},
11+
"raxx_static": {:hex, :raxx_static, "0.6.1", "8b48254fc3d1b8b1e473b7c307fbba0ae767c60482754ce823c664544c85d729", [:mix], [{:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:raxx, "~> 0.15.2", [hex: :raxx, repo: "hexpm", optional: false]}], "hexpm"},
12+
}

priv/localhost/certificate.pem

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIDPjCCAiYCCQDrSpjNLJXcbTANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJV
3+
SzEPMA0GA1UECAwGTG9uZG9uMQ8wDQYDVQQHDAZMb25kb24xHDAaBgNVBAoME1dv
4+
cmtzaG9wIDE0IExpbWl0ZWQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xNzA0Mjkx
5+
NzEyMTJaFw0xODA0MjkxNzEyMTJaMGExCzAJBgNVBAYTAlVLMQ8wDQYDVQQIDAZM
6+
b25kb24xDzANBgNVBAcMBkxvbmRvbjEcMBoGA1UECgwTV29ya3Nob3AgMTQgTGlt
7+
aXRlZDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
8+
MIIBCgKCAQEAmNvyeepIRsAm6QuUezhFf3KXTygBoYX4oYMfXb6ZklDQ8QAT9Brs
9+
YUW1+QDDHPF3foDa+k4Mm8XL6/yHqQFutnhqqYysd/XovCG1ff7Vq0TpX7GAHGEv
10+
rTj/Q63xqVOmyZINgvi9TfRTIKZ5LIo6O0dV5LSv6cLTXa8bFBxybigTxL+HgzY0
11+
e3kQzuFSYLOxvLCd4j7YnTzOsYY8M49mNRDbja4SkDcRxqV0mJDUkUxayaDWXY06
12+
eY1RtiYHFeZQF/2iEKBnsm62VJcFiq/vnjNkc1SBxqIoXE7BrRe+yLi1TniMds8g
13+
GDUX0QqnhbuG/USuB0ev0VZNg+LiUYA/dQIDAQABMA0GCSqGSIb3DQEBCwUAA4IB
14+
AQAJaUbgakfrvtbD84hqpCGe0LmfCbjUEE5NIpu/TEvTjDgnuPVhwF2VBcVT6w96
15+
YPL3hxt9DsMUsXapaD5v+rGOVJGReKWyl1JN1nqd2BRkYD++6AznOul5WepXOSHO
16+
mCQOVPV2C3M+OYEDgLf9dcrGvpPJdexLLpy/xR1s9ZiNHKYGAfXxU6Va1uUi60lh
17+
g2jjTNkYhthLiqygatEViZ25D/N7GBUtbCLf7YBRDPId5JnAd2sFI4vGeJJZMee/
18+
RCWKyzC+ttY9AHClpUcLc9YdJUofFfwHjO+jFf1u19WfUxlC3GPh45hSFZ/g+Hz8
19+
OxDc8YfSk8VAjJHu2ap7G9+G
20+
-----END CERTIFICATE-----

priv/localhost/certificate_key.pem

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-----BEGIN RSA PRIVATE KEY-----
2+
MIIEowIBAAKCAQEAmNvyeepIRsAm6QuUezhFf3KXTygBoYX4oYMfXb6ZklDQ8QAT
3+
9BrsYUW1+QDDHPF3foDa+k4Mm8XL6/yHqQFutnhqqYysd/XovCG1ff7Vq0TpX7GA
4+
HGEvrTj/Q63xqVOmyZINgvi9TfRTIKZ5LIo6O0dV5LSv6cLTXa8bFBxybigTxL+H
5+
gzY0e3kQzuFSYLOxvLCd4j7YnTzOsYY8M49mNRDbja4SkDcRxqV0mJDUkUxayaDW
6+
XY06eY1RtiYHFeZQF/2iEKBnsm62VJcFiq/vnjNkc1SBxqIoXE7BrRe+yLi1TniM
7+
ds8gGDUX0QqnhbuG/USuB0ev0VZNg+LiUYA/dQIDAQABAoIBAQCOfA9ExzbCBGEA
8+
wFOSnDxj9UvHdDI4/ulonBIDzyPVeFGbJAh1dRc8AMAEMEqvUwGgwLndsh0cor5X
9+
5dgKmJQ7sHk0PDWTyHw9yWok3QMMl7q2AX26dnj7jfKbgquNu7TvlZ3UpMnIvWMz
10+
Pxoag2qOUQtmmWqUio99dzjVgULFHFOufcSfPsM1s71BhcZwcssG2JxmbjsG8r1w
11+
wR80p1VQjWzQdBe5Kgc+ZZZidf1SSW3W65zrdAV3tT9A78hmTdvhdXG9SOTu3Vt8
12+
Eab1eAewfds0FGJtUIzpJe6DCWFBnpAsGbWCf2CMkPRhWcLHVFN8jHO6KpKdqq0b
13+
bjXmZTAhAoGBAMZdXGqpFQWD73nVqrbdyZhtDU8VCAeT0d5XmlNQwvVPyPch50FL
14+
zDt2H9k6+Ko3p8wjSIWdKFvsqYuCFbBI8Lf4b3+Tu2Vi9ajFrnHyGUlB0X1Ny+nt
15+
iXpAUYCsGnp6hylzkNCGMQXQ55oDVjXr8/m/M8QpsGbAicu05HLuene5AoGBAMVF
16+
0pyZNhjNBiJ/p/9AR1Rao8jWC5e70jxXdqX3kbWzobD1+qNEEP0klpnJGUIMASTb
17+
P99OrY5Fo1bxJecLjrwpQU63d90erAnirq7luIjQnXHAT6lg7CZX4uNW+P/iqc8p
18+
bvmcue6ptWf4HPtqtLpxXzbAlAA6SN5UDpFLbuudAoGAGaVOYnfTwO/K0Uyfkp7g
19+
BnXq55OHgztIQd+/kw/49LBJAjJ+7IE5OWLPQU2PgqpJZmoVYTjtU90oGmJKHY2A
20+
mbhj6fGWo8gEjLpqEE9Fl6QLypB5UZglUwnnv6QAlF8tBF3tlhgTVHYqy02tIrGL
21+
zHk83xqotNAlwJF1i6praPkCgYABMGGLlhTQY3P1A0X08OM9K+quzDN3r6cdu/04
22+
FNzo9nM0CNeA4mkjzXOm66JeVoovOa8R3nyHTf4lCQEMenJayfjdy5dKWuP4j0g0
23+
P6g0EuXQCLOyNqZVuNPiQOTxTeFuITbNBFfOi3FPdhxem48JTKOhRdnegntr85++
24+
2nCJtQKBgE9wMkBbQGKQxgV1VtNuLdhBPrCnvFvInX+/M5eaOLmg9IeDWER1vv5m
25+
kHbAa6t+jvi70ZQPrwMmAVT6YawpUuR7Ttaga/QMThw0dSvUuiPLXPno3ZZl9GM4
26+
OwKJHTSsqQf3jIT86Bm3wh375B8Dw0PPJUtraAkE4ioidTKuDnD4
27+
-----END RSA PRIVATE KEY-----
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-----BEGIN CERTIFICATE REQUEST-----
2+
MIICpjCCAY4CAQAwYTELMAkGA1UEBhMCVUsxDzANBgNVBAgMBkxvbmRvbjEPMA0G
3+
A1UEBwwGTG9uZG9uMRwwGgYDVQQKDBNXb3Jrc2hvcCAxNCBMaW1pdGVkMRIwEAYD
4+
VQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCY
5+
2/J56khGwCbpC5R7OEV/cpdPKAGhhfihgx9dvpmSUNDxABP0GuxhRbX5AMMc8Xd+
6+
gNr6Tgybxcvr/IepAW62eGqpjKx39ei8IbV9/tWrROlfsYAcYS+tOP9DrfGpU6bJ
7+
kg2C+L1N9FMgpnksijo7R1XktK/pwtNdrxsUHHJuKBPEv4eDNjR7eRDO4VJgs7G8
8+
sJ3iPtidPM6xhjwzj2Y1ENuNrhKQNxHGpXSYkNSRTFrJoNZdjTp5jVG2JgcV5lAX
9+
/aIQoGeybrZUlwWKr++eM2RzVIHGoihcTsGtF77IuLVOeIx2zyAYNRfRCqeFu4b9
10+
RK4HR6/RVk2D4uJRgD91AgMBAAGgADANBgkqhkiG9w0BAQsFAAOCAQEAXlpo5GxS
11+
oAavAybmPwlPYq9UekjsucRUx7q8MdI9+6JFgVZkJ47NZeq1ynuFM0QFGWC3Sbyx
12+
q0yKD3/UHIItta/4nQev366jAfi2Se6IE9RYYcmly36joHUB0MtceLYEGwazJbaB
13+
yq5nI0wgLDlQ318Uh9g+rc0DAohuEm+Guvq5xIVOXrkidhlPOiSHcXtIgGzHbfnz
14+
oir5rhtRgpCgulFq18ZWeQpIZ1UvTz0QbPvnnUZiVDxQVvKHwdRAjtVoJmuD9fuz
15+
F1ZiqKQWe4nqEw5pJuCK5tBdquB9hlWxaJhs/sR4dhcrjvX+8VxbGGaLlJV2mcrA
16+
EheSjS4N675U3w==
17+
-----END CERTIFICATE REQUEST-----

test/test_helper.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ExUnit.start()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
defmodule Watercooler.WWW.HomePageTest do
2+
use ExUnit.Case
3+
4+
alias Watercooler.WWW.HomePage
5+
6+
test "returns the Raxx.Kit home page" do
7+
request = Raxx.request(:GET, "/")
8+
9+
response = HomePage.handle_request(request, %{})
10+
11+
assert response.status == 200
12+
assert response.headers == [{"content-type", "text/html"}]
13+
assert String.contains?(response.body, "Raxx.Kit")
14+
end
15+
end

test/watercooler_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
defmodule WatercoolerTest do
2+
use ExUnit.Case
3+
doctest Watercooler
4+
5+
end

0 commit comments

Comments
 (0)