Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

hareku/emosearch-api

develop
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
cmd
 
 
 
 
 
 
pkg
 
 
 
 
 
 
 
 
 
 
 
 
 
 

emosearch-api

Commands

Development

# Launch DynamoDB local (:8000) and DynamoDB Admin (:8001)
$ docker-compose up -d
# Create DynamoDB table
$ aws dynamodb create-table --cli-input-json file://config/dynamodb.json --endpoint-url http://localhost:8000

# Create environments file, and you have to edit some secrets.
$ cp config/sam-dev-env.example.json config/sam-dev-env.json

# Start API (:9000)
$ make
$ sam local start-api --port 9000 --env-vars config/sam-dev-env.json --docker-network emosearch-api_default

# Invoke a function manually
$ sam local invoke "ListSearchesToUpdateFunction" --env-vars config/sam-dev-env.json --docker-network emosearch-api_default

# Invoke a function with Lambda Event
$ touch event.json && echo '{"search_id":"123","user_id":"123"}' >> event.json
$ sam local invoke "ListSearchesToUpdateFunction" --event event.json --env-vars config/sam-dev-env.json --docker-network emosearch-api_default

Deployment

# Deploy by AWS CloudFormation, and append tags for cost management.
sam deploy --tags "Project=EmoSearchAPI"

Next, open AWS Secrets Manager console, and edit secrets to "GoogleServiceAccountKey", "TwitterConsumerSecret" and "TwitterConsumerKey".

After editing, you can see the API endpoint from CloudFormation output resoures.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages