Skip to content

john-latham/github-activity-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-activity-server

Build Status GitHub issues GitHub last commit

Requirements

Setup process

Local development

Invoking function locally using a local sample payload

sam local invoke --no-event OauthGithubAuthorizeFunction --parameter-overrides ParameterKey=GithubClientId,ParameterValue=foobar

Invoking function locally through local API Gateway

sam local start-api --parameter-overrides 'ParameterKey=GithubClientId,ParameterValue=XXXXXXX ParameterKey=GithubClientSecret,ParameterValue=XXXXXXX ParameterKey=GithubOatuhCallbackUrl,ParameterValue=http://127.0.0.1:8080/callback.html'

If the previous command ran successfully you should now be able to hit the following local endpoint to invoke your function http://localhost:3000/$FunctionPath

Packaging and deployment

Create S3 bucket:

aws s3 mb s3://BUCKET_NAME

Package Lambda (uploads to S3):

sam package \
    --output-template-file packaged.yaml \
    --s3-bucket BUCKET_NAME

Create Cloudformation Stack and deploy your SAM resources.

sam deploy \
    --template-file packaged.yaml \
    --stack-name github-activity-server \
    --capabilities CAPABILITY_IAM

After deployment is complete you can run the following command to retrieve the API Gateway Endpoint URL:

aws cloudformation describe-stacks \
    --stack-name github-activity-server \
    --query 'Stacks[].Outputs[?OutputKey==`ApiUrl`]' \
    --output table

Fetch, tail, and filter Lambda function logs

NOTE: This command works for all AWS Lambda functions; not just the ones you deploy using SAM.

sam logs -n OauthGithubAuthorizeFunction --stack-name github-activity-server --tail

Cleanup

In order to delete our Serverless Application recently deployed you can use the following AWS CLI Command:

aws cloudformation delete-stack --stack-name github-activity-server

About

[In progress] Github API/OAuth through AWS Lambda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.6%
  • Shell 19.4%