项目作者: bum752

项目描述 :
imageGetter API with AWS Lambda
高级语言: JavaScript
项目地址: git://github.com/bum752/imageGetter-lambda.git
创建时间: 2018-11-12T05:17:18Z
项目社区:https://github.com/bum752/imageGetter-lambda

开源协议:

下载


lambda

Build Status

imageGetter API with AWS Lambda

serveless 설치

  1. $ yarn global add serverless

AWS 인증

AWS IAM을 이용한 인증으로 두 가지 방법 중 하나를 실행하면 됩니다.

  1. # aws-cli
  2. $ aws configure
  3. # serverless
  4. $ serverless config credentials --provider aws --key <Access Key ID> --secret <Secret Access Key>

테스트 및 배포

의존성 설치

  1. $ yarn install

테스트

  1. $ yarn test

배포

(과금 주의!)

  1. $ serverless deploy
  • lambda의 환경변수에 SLACK_TOKENSLACK_CHANNEL을 등록해야 합니다.
    • SLACK_TOKEN = xoxb-****
    • SLACK_CHANNEL = #CHANNEL

함수 호출

  1. # local
  2. $ serverless invoke local --function imgs --data '{"pathParameters": {"encodedURI": "google.com"}}'
  3. # aws
  4. $ serverless invoke --function imgs --data '{"pathParameters": {"encodedURI": "google.com"}}'

삭제

과금에 주의해 배포 된 서비스를 삭제합니다.

  1. $ serverless remove