瀏覽代碼

Small fixes

- Use plug formatter
- Add fallback match
- Remove tabs!
master
Ryan Johnson 3 年之前
父節點
當前提交
85c46f927f
共有 3 個文件被更改,包括 10 次插入5 次删除
  1. +2
    -1
      .formatter.exs
  2. +2
    -2
      README.md
  3. +6
    -2
      lib/plug_micropub.ex

+ 2
- 1
.formatter.exs 查看文件

@ -1,4 +1,5 @@
# Used by "mix format"
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"],
import_deps: [:plug]
]

+ 2
- 2
README.md 查看文件

@ -30,8 +30,8 @@ If you want `PlugMicropub` to serve only a particular route, configure your rout
forward "/micropub",
to: PlugMicropub,
init_opts: [
handler: MyApp.MicropubHandler,
json_encoder: Poison
handler: MyApp.MicropubHandler,
json_encoder: Poison
]
```


+ 6
- 2
lib/plug_micropub.ex 查看文件

@ -7,8 +7,8 @@ defmodule PlugMicropub do
"""
use Plug.Router
plug(:match)
plug(:dispatch)
plug :match
plug :dispatch
# Plug Callbacks
@ -64,6 +64,10 @@ defmodule PlugMicropub do
end
end
match _ do
send_error(conn, {:error, :invalid_request})
end
# Internal Functions
defp send_content(conn, content) do


Loading…
取消
儲存