This repository is a Covalent Serverless Application deployed on Amazon Web Services. This wrapper will assist developers who want to utilize Covalent data without any server setup needed (serverless).
There consist of 2 modules:
A Lambda function for requesting Covalent API.
-
Click Create function Button to start creating function
-
Enter your Lambda function information
-
Click
Create functionButton -
Now go back to
aws-lambdadirectory -
Install dependencies
npm install -
Zip all files and folders inside
aws-lambdadirectory -
Upload
.zipfile on Code section
-
Go to Configuration section
-
General configuration
- set Timeout to 30 seconds
-
Environment variables
API_HOST = https://api.covalenthq.com/v1/ API_KEY = {YOUR_COVALENT_API_KEY}
-
-
Click
+ Add triggerButton
-
Set Trigger configuration
-
Click
AddButton -
After add trigger successfully, you will find the
API Gateway: covalenttrigger -
You can get your
API endpointin Details -
How to use your API on AWS
GET {API endpoint}?path={COVALENT_API_PATH}¶m1=value1¶m2=value2&...
An example of React app using create-react-app.
-
Go to
react-appdirectory -
Set environment variable in .env file
REACT_APP_COVALENT_API_AWS_URL={AWS_API_GATEWAY_ENDPOINT} -
Install dependencies
npm install --force -
Run on localhost
npm start -
Build app
npm run build -
Deploy app on AWS S3 (Optional)
-
Create AWS S3 Bucket for Hosting a static website
-
Install AWS CLI
-
Edit deploy script in package.json file
Replace
{YOUR_S3_BUCKET_NAME}with your AWS S3 Bucket name"deploy": "aws s3 sync build/ s3://{YOUR_S3_BUCKET_NAME} --acl public-read" -
Deploy app
npm run deploy -
Now you can visit yout website
-