Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3に画像をuploadするsigned_urlを発行するend_pointの作成 #15

Merged
merged 2 commits into from
May 5, 2020

Conversation

nakao107107
Copy link
Collaborator

@nakao107107 nakao107107 commented May 4, 2020

概要

ファイル名を指定して送ると、s3に画像を保存するsigned_urlを発行する
保存されるファイル名はrequestで指定したファイル名の最初に時間の文字列を組み合わせたものになる

準備

  • 環境変数のcopy
cp .env.example .env
  • 環境変数の内容の編集

Request

method: GET
end_point: /signed_url?image=$image_name

Response

{
  "file_key": "2020-05-04T15:15:54Ztest.png",
  "signed_url": "https://ca-home-hackathon.s3.ap-northeast-1.amazonaws.com..."
}

methods for uploading image with signed url

curl -XPUT --upload-file $img_path $signed_url

Copy link
Collaborator

@kkmory kkmory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
GAEへのデプロイ用にGitHub Actionsの設定で環境変数を渡す必要があるので、設定方法は追って説明します!

@nakao107107 nakao107107 merged commit b976424 into develop May 5, 2020
@nakao107107 nakao107107 deleted the feature/signed_url branch May 5, 2020 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants