An API for timereport
- AWS API Gateway
- AWS lambda
- AWS dynamodb
- aws credentials for dynamodb access
- aws credentials for travis-ci
- edit .chalice/config.json env variables
- pre-commit
[
{
"reason": "sick",
"hours": "8",
"user_name": "Mr User",
"user_id": "user101",
"event_date": "2019-03-21"
}
]
The API v1 routes requires authentication via the Authorization
header.
API key is set via CHALICE_API_KEY
variable in the Makefile.
Example request via httpie
:
# http localhost:8010/v1/table-names 'Authorization: development'
- Docker (to run amazon/dynamodb-local)
- packages in requirements.txt OR
pipenv install
To start a local dynamodb, setup config and start chalice:
- Set the env variable
DB_HOST
tohttp://localhost:8000
- Create config and start chalice
$ make config
$ make run
Now you should be able to try the API on http://localhost:8010 or run the tests pipenv run pytest
To stop and cleanup:
make clean
Deployment to dev and prod is done automatically via github actions
See dev.yml for details.
See prod.yml for details.
note: This requires that you have setup the credentials for AWS
chalice deploy --stage dev
chalice deploy --stage prod
Install the packages (use pipenv)
# make run
# pytest -v tests