16 lines
361 B
Crystal
16 lines
361 B
Crystal
require "json"
|
|
|
|
class Articles::Show < BrowserAction
|
|
get "/posts/:post_id" do
|
|
if Lucky::Env.use_local?
|
|
response = LocalClient.post_data(post_id)
|
|
else
|
|
response = MediumClient.post_data(post_id)
|
|
end
|
|
page = PageConverter.new.convert(
|
|
response.data.post.content.bodyModel.paragraphs
|
|
)
|
|
html ShowPage, page: page
|
|
end
|
|
end
|