You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ryan Johnson c6976ac951
Merge pull request #2 from inhji/handle_syndicate_to_query
1 year ago
config Initial commit 2 years ago
lib add handle_syndicate_to_query, fix handle_undelete signature 1 year ago
test Initial commit 2 years ago
.formatter.exs Small fixes 2 years ago
.gitignore Initial commit 2 years ago
LICENSE Initial commit 2 years ago
README.md Small fixes 2 years ago
mix.exs Initial commit 2 years ago
mix.lock Initial commit 2 years ago

README.md

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