This is a recognition API project from Erick Wendel Aplicações Serverless na AWS com Node.js_ course.
- NodeJS
- AWS SDK
- Serverless framework
- AWS Rekognition
- AWS Lambda
- AWS Translate
First of all, you will need to have an account on AWS and Serverless framework, and then set your AWS credentials to connect both.
Next, you need to clone this project, enter in the folder and install the dependencies:
$ git clone http://url.com
$ cd ./folder
$ npm i
After this, update the field org:
in the top of the file serverless.yml
, with your Serverless Framework org. You can find it on your Serverless framework profile:
org: <YOUR_ORG_HERE>
Then, deploy the serverless app:
$ serverless deploy
so you can invoke the function. The --path
flag is pointing to the request.json
configuration file. I've put my Github profile photo in the imageUrl
field, but you can update it with another image URL to the AWS Rekognition service analyse it:
$ serverless invoke -f img-analysis --path request.json
You can invoke the function without deploy by setting the option local
:
$ serverless invoke local -f img-analysis --path request.json
You can invoke the function putting the url returned by serverless deploy
in the browser and set a query string called imageUrl
with the desired url. You can find the url on Serverless dashboard too:
https://<YOUR_ENDPOINT>?imageUrl=<YOUR_IMAGE_URL>