Commit 665747d7 authored by Nick Stalter's avatar Nick Stalter
Browse files

initial commit

parents
# The directory Mix will write compiled artifacts to.
/_build
# If you run "mix test --cover", coverage assets end up here.
/cover
# The directory Mix downloads your dependencies sources to.
/deps
# Where 3rd-party dependencies like ExDoc output generated docs.
/doc
# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump
# Also ignore archive artifacts (built via "mix archive.build").
*.ez
# Coffeebot
**TODO: Add description**
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:
1. Add `coffeebot` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:coffeebot, "~> 0.1.0"}]
end
```
2. Ensure `coffeebot` is started before your application:
```elixir
def application do
[applications: [:coffeebot]]
end
```
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
# file won't be loaded nor affect the parent project. For this reason,
# if you want to provide default values for your application for
# 3rd-party users, it should be done in your "mix.exs" file.
# You can configure for your application as:
#
# config :coffeebot, key: :value
#
# And access this configuration in your application as:
#
# Application.get_env(:coffeebot, :key)
#
# Or configure a 3rd-party app:
#
# config :logger, level: :info
#
# It is also possible to import configuration files, relative to this
# directory. For example, you can emulate configuration per environment
# by uncommenting the line below and defining dev.exs, test.exs and such.
# Configuration from the imported file will override the ones defined
# here (which is why it is important to import them last).
#
# import_config "#{Mix.env}.exs"
config :trot, :port, 4001
config :trot, :router, Coffeebot.Router
defmodule Coffeebot.Router do
use Trot.Router
get "/" do
conn = put_resp_content_type(conn, "application/json")
message = %{"response_type" => "in_channel", "text" => "༼ つ ◕_◕ ༽つ Heres your coffee :coffee: ༼ つ ◕_◕ ༽つ"}
|> Poison.encode!([])
send_resp(conn, 200, message)
end
import_routes Trot.NotFound
end
defmodule Coffeebot.Mixfile do
use Mix.Project
def project do
[app: :coffeebot,
version: "0.1.0",
elixir: "~> 1.3",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps()]
end
# Configuration for the OTP application
#
# Type "mix help compile.app" for more information
def application do
[applications: [:logger, :trot]]
end
# Dependencies can be Hex packages:
#
# {:mydep, "~> 0.3.0"}
#
# Or git/path repositories:
#
# {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
#
# Type "mix help deps" for more examples and options
defp deps do
[{:trot, github: "hexedpackets/trot"},
{:poison, "~> 1.4"}]
end
end
%{"calliope": {:hex, :calliope, "0.3.0", "81c2937b27094eee8f8a3fce5effb9140cb8a1fbc03620c6ff57a798d400a3ce", [:mix], []},
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:rebar, :make], [{:cowlib, "~> 1.0.0", [hex: :cowlib, optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, optional: false]}]},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], []},
"mime": {:hex, :mime, "1.0.1", "05c393850524767d13a53627df71beeebb016205eb43bfbd92d14d24ec7a1b51", [:mix], []},
"plug": {:hex, :plug, "1.2.0", "496bef96634a49d7803ab2671482f0c5ce9ce0b7b9bc25bc0ae8e09859dd2004", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, optional: true]}, {:mime, "~> 1.0", [hex: :mime, optional: false]}]},
"plug_heartbeat": {:hex, :plug_heartbeat, "0.2.0", "912485e20cf483da21d6dfd4f6ed0dcc8d497f497b123231a73a326239b3f2f1", [:mix], [{:cowboy, ">= 1.0.0", [hex: :cowboy, optional: false]}, {:plug, ">= 0.12.0", [hex: :plug, optional: false]}]},
"poison": {:hex, :poison, "1.5.2", "560bdfb7449e3ddd23a096929fb9fc2122f709bcc758b2d5d5a5c7d0ea848910", [:mix], []},
"ranch": {:hex, :ranch, "1.2.1", "a6fb992c10f2187b46ffd17ce398ddf8a54f691b81768f9ef5f461ea7e28c762", [:make], []},
"trot": {:git, "https://github.com/hexedpackets/trot.git", "ff9da25440914b6d4c4b8feb21577420193aebf4", []}}
defmodule CoffeebotTest do
use ExUnit.Case
doctest Coffeebot
test "the truth" do
assert 1 + 1 == 2
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment