Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Latest commit

 

History

History
34 lines (19 loc) · 1.3 KB

README.md

File metadata and controls

34 lines (19 loc) · 1.3 KB

Average hours

Note
Moved to grrr-amsterdam/grrr-bot.

API to calculate the average hours worked on a day. The source is the Productive API.

Endpoint: POST /average-hours

The GRRR Slack workspace contains an app with slash command: /average-hours [days].

The Lambda function uses a cache layer to make Parameter Store parameters available in the function:docs.

Known issues and improvements

  • Doesn't run locally because it depends on a cache layer which loads the configuration files upfront.
  • No CI with auto deploy and Prettier.
  • Sentry monitoring is missing.

Local development

Checkout the code and run npm install.

This Lambda function uses a cache layer to fetch the configuration for Parameter Store upon starting the Lambda function. The configuration isn't loaded at runtime.

Activate your personal AWS profile. Serverless will create a assume role for the Lambda function.

# npx serverless invoke local --function slack --path test/slack-command-average-hours-20-days.json

Deploy

The Lamdba function is currently running in GRRR AWS account.

npx serverless deploy