This project contains an AWS Lambda function implemented in the Node.js runtime. It serves clients of the service - mobile and other.
- Clone the repository from Github
- Set up AWS
sam cli
:$ pip install --user aws-sam-cli
- Make sure the sam binary is globally available in your shell:
$ export PATH=$PATH:~/Library/Python/2.7/bin
where the path is the path to where your pip modules install to - Restart your shell, and type
$ sam --version
- it should display the version, if it doesn't something has gone wrong. - The template.yaml file should be included in the git repo, so you shouldn't have to run
$ sam init
- Install the required dependancies:
$ npm install
- Running: Use
$ sam local invoke "sqClientAPI" -e tests/_test.json
This should start a docker container on your local machine and invoke the function with an input. - You can use the debugger of your choice - connect it to port 5858. Full command:
$ sam local invoke "sqClientAPI" -e tests/_test.json --debug-port 5858
change the json file according to the desired test. - If you were running any other Docker containers with port 5858 open as a debug port, you may need to restart Docker.
To deploy new code:
- Upload a zipped file of the repo to the S3 bucket: sensesir-code-store | Recommend using CLI:
$ aws s3 cp sqc-xxx.zip s3://self-quants-code-store/client-api/
- In the Lambda management console, navigate to the SQClientAPI function
- In the Function code section, use the
Code entry type
dropdown to select "Upload a file from Amazon S3" - Click Save in the top right hand corner - this will 'deploy' the new code
Root Endpoint: https://
The API uses an api key for security, and this should be submitted as a header: x-api-key