1
0
mirror of https://github.com/danbee/micropub.git synced 2025-03-04 08:59:13 +00:00

Use env.fetch and default to master branch

This commit is contained in:
Daniel Barber 2019-11-11 18:14:16 -05:00
parent a8ab4a25f9
commit 3365485720
2 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ module Micropub
path: path,
message: "Posting a post",
content: post.post_content,
branch: "api_test",
branch: ENV.fetch("GITHUB_BRANCH", "master"),
)
end

View File

@ -10,7 +10,7 @@ module Micropub
github = Github.new
endpoints = Indieauth::Endpoints.new(ENV["SITE_URL"])
endpoints = Indieauth::Endpoints.new(ENV.fetch("SITE_URL"))
token = Indieauth::Token.new(endpoints.token_endpoint)
get '/' do
@ -24,7 +24,7 @@ module Micropub
end
post "/micropub/main" do
if token.validate(ENV["INDIEAUTH_TOKEN"])
if token.validate(ENV.fetch("INDIEAUTH_TOKEN"))
post = Post.new(params)
if github.post!(post)