Initial commit
This commit is contained in:
31
app/actions/site/config.rb
Normal file
31
app/actions/site/config.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
module Adamantium
|
||||
module Actions
|
||||
module Site
|
||||
class Config < Action
|
||||
include Deps["settings", "views.site.home"]
|
||||
|
||||
def handle(req, res)
|
||||
if req.params[:q] == "config"
|
||||
res.status = 200
|
||||
res.content_type = "Application/JSON"
|
||||
res.body = {
|
||||
"media-endpoint" => settings.micropub_media_endpoint,
|
||||
"destination" => [
|
||||
{uid: settings.micropub_site_id, name: settings.micropub_site_name}
|
||||
],
|
||||
"post-types" => [
|
||||
{type: "note", name: "Note", properties: %w[content category]},
|
||||
{type: "article", name: "Article", properties: %w[name content category]},
|
||||
{type: "photo", name: "Photo", properties: %w[name content category]},
|
||||
{type: "bookmark", name: "Bookmark", properties: %w[name content category]}
|
||||
],
|
||||
"syndicate-to" => []
|
||||
}.to_json
|
||||
else
|
||||
res.render home
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user