Add source response

This commit is contained in:
2023-02-03 11:16:31 +11:00
parent dd31388c2c
commit 19fe581c79
5 changed files with 54 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ module Adamantium
module Actions
module Site
class Config < Action
include Deps["settings", "views.site.home"]
include Deps["settings", "views.site.home", "queries.posts.microformat_post"]
before :authenticate!
def handle(req, res)
@@ -46,6 +46,10 @@ module Adamantium
}
]
}.to_json
elsif req.params[:q] == "source"
res.status = 200
res.content_type = "Application/JSON"
res.body = microformat_post.call(url: req.params[:url], properties: req.params[:properties]).to_json
else
res.render home
end