Boilerplate Serverless API that will be invoked by a Shopify webhook.
- Visual Studio Code
- AWS Cli tools - You'll need to configure your AWS access for the cli before you invoke any aws cli or serverless commands. Refer to AWS documentation and run
aws configre
- Node v8.10
- Serverless -
npm i -g serverless
set region=ap-southeast-2
set stage=dev
set logLevel='debug'
set shopifySecret='[obtain from password state]'
To deploy from your local machine to AWS:
- ensure you are in
ap-southeast-2
(Sydney) region fordev
- Ensure you have set your environment variables as above
- Ensure you have installed all of the node package dependencies via
npm i
To run serverless deployment:
sls deploy
To deploy a single task/function:
sls deploy -f functionName
To remove this deployment:
sls remove
This API is authenticated via a Hash (Header[X-Shopify-Hmac-Sha256]
) check which is a combination of a shared secret key (between Shopify and the API) and the payload - represented as a sha1 encrypted value. If the authentication passes, the api will continue processing, if not it will return Forbidden 403
.
A 200
Ok HTTP Status
response will be returned upon authentication passing.
A 403
Forbidden HTTP Status
response will be returned upon authentication failing.