yarn install
yarn dev
To create a production version of your app:
yarn build
You can preview the production build with yarn preview
.
Once changes are made, build the JS:
yarn lambda:compile
If you want to test the lambda function locally you can use:
node -e 'require("./index").handler()'
You'll just have to set a test image, or pass one in.
Since the output is in base64, you can copy it an convert it to an image using this converter.
Zip the code (this also excludes the node_modules
because canvas
is handled by a Lambda Layer):
yarn lambda:zip
And deploy it:
yarn lambda:deploy
If not authenticated:
aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin <AWS-ACCOUNT-ID>.dkr.ecr.us-east-2.amazonaws.com