I hereby claim:
- I am adanselm on github.
- I am adanselm (https://keybase.io/adanselm) on keybase.
- I have a public key ASA7eWU1aZUBiQ3IZVqt2ujTx_gS7RP7ULLUjyH4CPXI0go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
defmodule MyApp.PlugRouter do | |
use Plug.Router | |
require Logger | |
plug Plug.Parsers, parsers: [:urlencoded, :multipart, :json], | |
pass: ["*/*"], | |
json_decoder: Poison | |
plug :match |
defmodule CompareDirs do | |
def compare(ref, target) do | |
ref_list = md5_dir(ref) | |
target_list = md5_dir(target) | |
Enum.reduce(ref_list, [], fn({path, hash}, acc) -> | |
case Enum.find(target_list, fn({_t_path, t_hash}) -> t_hash == hash end) do | |
true -> acc | |
_ -> acc ++ [path] |
defmodule ObesebirdApi.Tasks do | |
import Ecto.Query | |
alias ObesebirdApi.Slot | |
alias ObesebirdApi.Post | |
alias ObesebirdApi.Repo | |
require Logger | |
def get(day_of_week, {hour, min, _sec}) do | |
query = from s in Slot, |
defmodule ObesebirdApi.Scheduler do | |
use GenServer | |
alias ObesebirdApi.Slot | |
alias ObesebirdApi.Tasks | |
require Logger | |
# Server | |
def init(args) do | |
case Process.send(self, :check, []) do |
language: elixir | |
elixir: | |
- 1.0.4 | |
otp_release: | |
- 17.4 | |
addons: | |
postgresql: '9.3' | |
before_script: | |
- MIX_ENV=test mix do deps.get, deps.compile, ecto.create, ecto.migrate | |
deploy: |
use Mix.Config | |
# In this file, we keep production configuration that | |
# you likely want to automate and keep it away from | |
# your version control system. | |
config :obesebird_api, ObesebirdApi.Endpoint, | |
secret_key_base: System.get_env("SECRET_KEY_BASE") | |
# Configure your database | |
config :obesebird_api, ObesebirdApi.Repo, |
defmodule ObesebirdApi.Router do | |
use ObesebirdApi.Web, :router | |
pipeline :api do | |
plug :accepts, ["json"] | |
end | |
scope "/api", ObesebirdApi do | |
pipe_through :api |
api_user_path GET /api/users SbSso.Api.UserController.index/2 | |
api_user_path GET /api/users/:id SbSso.Api.UserController.show/2 | |
api_user_path POST /api/users SbSso.Api.UserController.create/2 | |
api_user_path PATCH /api/users/:id SbSso.Api.UserController.update/2 | |
PUT /api/users/:id SbSso.Api.UserController.update/2 | |
api_user_path DELETE /api/users/:id SbSso.Api.UserController.destroy/2 | |
api_user_subscription_path GET /api/users/:user_id/subs SbSso.Api.SubscriptionController.index/2 | |
api_user_subscription_path GET /api/users/:user_id/subs/:id SbSso.Api.SubscriptionController.show/2 | |
api_user_subscription_path POST /api/users/:user_id/subs SbSso.Api.SubscriptionController.create/2 | |
api_product_path GET /api/products SbSso.Api.ProductController.index/2 |
defmodule SbSso.Router do | |
use Phoenix.Router | |
pipeline :api do | |
plug :accepts, ~w(json) | |
end | |
# /API section | |
scope "/api", alias: SbSso.Api, as: :api do | |
pipe_through :api |