This repo demonstrates a working, basic implementation of a TripleCheck broker running on Vercel with the database in FaunaDB.
Refer to the documentation on the broker for how to call the API.
Technology choices are:
- A Vercel account
- 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
.env
file (go ahead and rename theenv
file provided in the repo) like this:FAUNA_KEY=some-secret-random-key
- Create a new collection (call it
triplecheck
) - Create an index called
Key
and set the term todata.key
; also enableSerialized
andUnique
The easiest way to do this is to go to Vercel's web console, navigate to your Project Settings
and 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
.
The default settings should work all right.
Run npm run deploy
or yarn run deploy
.
The default settings should work all right.
Run npm run remove
or yarn run remove
. You'll have to provide the npm script command your project name before this will work.