This repo demonstrates a working, basic implementation of a TripleCheck broker running on Netlify Functions (really just AWS Lambda) with the database in FaunaDB.
Refer to the documentation on the broker for how to call the API.
Technology choices are:
- A Netlify account
- A Fauna account
- Logged in to Netlify
- FaunaDB account and a database that's set up correctly (outlined below)
- In Fauna, create a database called
triplecheck-broker. - Under
Security, create a key for the database and set the role toServer - Paste the key's value into an
.envfile (go ahead and rename theenvfile provided in the repo) like this:FAUNA_KEY=some-secret-random-key - Create a new collection (call it
triplecheck) - Create an index called
Keyand set the term todata.key; also enableSerializedandUnique
The easiest way to do this is to go to Netlify's web console, navigate to your project and under Build & deploy set a key under Environment variables like this: FAUNA_KEY with your key as the value.
Run npm install or yarn install.
Run npm start or yarn start.
Run npm run deploy or yarn run deploy.
You will have to remove your function manually through the Netlify web console.
