No description
Find a file
Ryan Johnson c6976ac951
Merge pull request #2 from inhji/handle_syndicate_to_query
add handle_syndicate_to_query, fix handle_undelete signature
2019-04-19 08:09:48 -07:00
config Initial commit 2018-03-19 22:42:15 -07:00
lib add handle_syndicate_to_query, fix handle_undelete signature 2019-04-17 20:36:43 +02:00
test Initial commit 2018-03-19 22:42:15 -07:00
.formatter.exs Small fixes 2018-04-11 22:50:37 -07:00
.gitignore Initial commit 2018-03-19 22:42:15 -07:00
LICENSE Initial commit 2018-03-19 22:42:15 -07:00
mix.exs Initial commit 2018-03-19 22:42:15 -07:00
mix.lock Initial commit 2018-03-19 22:42:15 -07:00
README.md Small fixes 2018-04-11 22:50:37 -07:00

PlugMicropub

A small library for helping build a Plug-based Micropub server.

A basic example server that implements all Micropub Rocks! validation tests can be found here.

Usage

Basic Usage:

plug Plug.Parsers,
  parsers: [:urlencoded, :multipart, :json],
  pass: ["*/*"],
  json_decoder: Poison

plug PlugMicropub,
  handler: MyApp.MicropubHandler,
  json_encoder: Poison 

Forwarding

If you want PlugMicropub to serve only a particular route, configure your router like:

Plug.Router

forward "/micropub",
  to: PlugMicropub,
  init_opts: [
    handler: MyApp.MicropubHandler,
    json_encoder: Poison
  ]

Phoenix.Router

forward "/micropub",
  PlugMicropub,
  handler: MyApp.MicropubHandler,
  json_encoder: Poison