Refactor micropub specific things out to a slice
This commit is contained in:
@@ -23,9 +23,16 @@ module Adamantium
|
||||
config.logger.stream = "log/hanami.log"
|
||||
|
||||
config.shared_app_component_keys += [
|
||||
"post_utilities.slugify",
|
||||
"syndication.dayone",
|
||||
"syndication.mastodon",
|
||||
"syndication.blue_sky",
|
||||
"syndication.raindrop",
|
||||
"renderers.markdown",
|
||||
"post_utilities.link_finder"
|
||||
"post_utilities.link_finder",
|
||||
"param_parser.micropub_post",
|
||||
"param_parser.webmention",
|
||||
"post_utilities.page_cacher"
|
||||
]
|
||||
end
|
||||
end
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Hanami.app.register_provider :param_parser, namespace: true do
|
||||
start do
|
||||
register "micropub_post", Adamantium::MicropubRequestParser.new
|
||||
register "micropub_post", Micropub::RequestParser.new
|
||||
register "webmention", Adamantium::WebmentionRequestParser.new
|
||||
end
|
||||
end
|
||||
|
@@ -9,14 +9,7 @@ module Adamantium
|
||||
use Hanami::Middleware::BodyParser, [:form, :json]
|
||||
# use Adamantium::Middleware::ProcessParams
|
||||
|
||||
scope "micropub" do
|
||||
get "/", to: "site.config"
|
||||
post "/", to: "posts.handle"
|
||||
post "/media", to: "media.create"
|
||||
get "/media", to: "media.show"
|
||||
|
||||
post "/webmentions", to: "webmentions.create"
|
||||
end
|
||||
slice :micropub, at: "/micropub"
|
||||
|
||||
get "/", to: "site.home"
|
||||
get "/post/top_tracks/:slug", to: "posts.top_tracks"
|
||||
|
Reference in New Issue
Block a user