Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

I needed to set FAUNADB_SERVER_SECRET as well as FAUNADB_SECRET for the app to work #7

Open
sihorton opened this issue Feb 24, 2019 · 2 comments

Comments

@sihorton
Copy link

sihorton commented Feb 24, 2019

The FAUNADB_SECRET was needed to create the table in faunadb, but I only got unauthorized errors when running the app. Looking in the code I found it is using the FAUNADB_SERVER_SECRET environment variable to actually make the calls, once I set that as well then the application ran and I could create todo entries. The functions/todos-real-all.js contains the following code for example.

const client = new faunadb.Client({
secret: process.env.FAUNADB_SERVER_SECRET
})

Easy fix is to set both env variables (e.g. in windows):
set FAUNADB_SECRET= (admin key)
set FAUNADB_SERVER_SECRET= (server key)

The keys were set at the in the fauna cloud dashboard: https://dashboard.fauna.com/keys/@db/

So all that is needed is for the tutorial to be updated to instruct both environmental variables to be set. First time using netlify and first time using faunadb so good if it works out of the box as a good demo.

@s10mcow
Copy link

s10mcow commented Apr 5, 2019

+1

@sethburtonhall
Copy link

+1 Thank You!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants