First, have a look at the aws.json
file, you will need to add your AWS credentials to it:
{
"accessKeyId": "<YOUR_ACCESS_KEY>",
"secretAccessKey": "<YOUR_SECRET_KEY>",
"region": "us-east-1"
}
If you don't know what are your access and secret key, you can use this link to figure it out.
Now you need to login on aws lambda console so you can create your lambda. Here is the contract:
{
firstNumber: <ANY>
secondNumber: <ANY>
}
{
statusCode: <NUMBER>
body: <ANY>
}
Take note of your lambda name, you'll need it here.
On index.js
look for:
var injectedLambdaMethod = '<YOUR_LAMBDA_NAME_HERE>';
And replace the string <YOUR_LAMBDA_NAME_HERE>
by the name of the lambda method you created.
npm run start
You can now run your code at http://localhost:3000/2/4