diff --git a/README.md b/README.md index 6b00b51..9fbc87c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Netlify + FaunaDB -Example of using FaunaDB with [netlify functions](https://www.netlify.com/docs/functions/) +Example of using FaunaDB with [Netlify functions](https://www.netlify.com/docs/functions/) Deploy this app with one-click via this link: @@ -28,7 +28,17 @@ Deploy this app with one-click via this link: npm run bootstrap ``` -4. Run project locally +4. Set your Fauna API key value in your terminal enviroment + + You can create faunaDB keys here: https://dashboard.fauna.com/db/keys + + In your terminal run the following command: + + ```bash + export FAUNADB_SECRET=YourFaunaDBKeyHere + ``` + +5. Run project locally ```bash npm start diff --git a/scripts/bootstrap-fauna-database.js b/scripts/bootstrap-fauna-database.js index 6652516..fe1824e 100644 --- a/scripts/bootstrap-fauna-database.js +++ b/scripts/bootstrap-fauna-database.js @@ -63,6 +63,10 @@ function createFaunaDB(key) { }) } + +/* util methods */ + +// Test if inside netlify build context function insideNetlifyBuildContext() { if (process.env.DEPLOY_PRIME_URL) { return true diff --git a/scripts/check-for-fauna-key.js b/scripts/check-for-fauna-key.js index 53191cd..4a8fb84 100644 --- a/scripts/check-for-fauna-key.js +++ b/scripts/check-for-fauna-key.js @@ -8,12 +8,14 @@ function clear(){ }); } function checkForFaunaKey() { - if (!process.env.FAUNADB_SECRET) { + if (!process.env.FAUNADB_SECRETz) { console.log(chalk.yellow('Required FAUNADB_SECRET enviroment variable not found.')) console.log(` ========================= -In your terminal run the following command +You can create fauna DB keys here: https://dashboard.fauna.com/db/keys + +In your terminal run the following command: export FAUNADB_SECRET=YourFaunaDBKeyHere @@ -21,13 +23,7 @@ export FAUNADB_SECRET=YourFaunaDBKeyHere `) process.exit(1) - process.stdout.write('\u001b[2J') - process.stdout.write('\u001b[1;1H') } } -process.on('exit', (err) => { - console.log('errr') -}); - checkForFaunaKey()