Unofficial Serverless Payment API for the Reef blockchain. This repo was set-up as part of the Gitcoin Defi Hackathon.
AWS DynamoDB + Lambda codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase contains code written for the below hackathon bounty. https://gitcoin.co/issue/reef-defi/reef-finance-bounties/1/100026837
Storefront - https://github.com/rtre84/reef-payments-store
Products service - https://github.com/rtre84/reef-products-service
AWS Lambda Payment API - https://github.com/rtre84/reef-lambda-payments
Git clone https://github.com/rtre84/reef-payments-store
Run yarn install
Run yarn dev
NOTE: The Polkadot / Reef finance specific code isn't completely functional in it's current state. All code is deployable and accessible locally. Unresolved bugs in the product and lambda service blocked the service from working end to end correctly.
Storefront Demo: https://eager-jang-5dfc4d.netlify.app/
Product Service: https://reef-frontend-product-service.herokuapp.com/health
Lambda API Gateway Service: https://1qnnysgv5d.execute-api.us-east-1.amazonaws.com/dev/
Requires Node 8 or higher
Clone this repo, and cd into it:
git clone https://github.com/rtre84/reef-lambda-payments
cd reef-lambda-payments
npm install
npm run start
This should start local DynamoDB emulator and Serverless offline. You can now make API calls against http://localhost:3000/api
like this:
curl http://localhost:3000/api/articles
Serverless: GET /api/articles (λ: listArticles)
Serverless: The first request might take a few extra seconds
Serverless: [200] {"statusCode":200,"headers":{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Credentials":true},"body":"{\"articles\":[]}"}
npm test
See sample test run log and network traffic.
The API is described in the serverless.yml
file.
For storage, AWS DynamoDB a managed serverless NoSQL database is used.
To deploy the code to AWS, simply execute:
npm run deploy
This will use serverless
to deploy the API as described in serverless.yml
.
Once deployed, you can test the deployed API by executing:
npm run test:deployed