diff --git a/README.md b/README.md index 86a9058..c23cb4e 100644 --- a/README.md +++ b/README.md @@ -37,70 +37,62 @@ Click the [Deploy to Netlify Button](https://app.netlify.com/start/deploy?reposi ## Setup & Run Locally -1. Clone down the repository - - ```bash - git clone https://github.com/netlify/netlify-faunadb-example.git - ``` - -2. Enter the repo directory - - ```bash - cd netlify-faunadb-example - ``` - -3. Install the dependencies - - ```bash - npm install - ``` - -4. Sign up for a FaunaDB account - - https://dashboard.fauna.com/accounts/register - -5. Create a database - - In the Fauna Cloud Console: - - Click “New Database” - - Enter “Netlify” as the “Database Name” - - Click “Save” - -6. Create a database access key - - In the Fauna Cloud Console: - - Click “Security” in the left navigation - - Click “New Key” - - Make sure that the “Database” field is set to “Netlify” - - Make sure that the “Role” field is set to “Admin” - - Enter “Netlify” as the “Key Name” - - Click “Save” - -7. Copy the database access key’s secret - - Save the secret somewhere safe; you won’t get a second chance to see it. - -8. Set your database access secret in your terminal environment - - In your terminal, run the following command: - - ```bash - export FAUNADB_SERVER_SECRET=YourFaunaDBSecretHere - ``` +### 1. Clone down the repository +```bash +git clone https://github.com/netlify/netlify-faunadb-example.git +``` - Replace `YourFaunaDBSecretHere` with the value of the secret that you copied in the previous step. +### 2. Enter the repo directory +```bash +cd netlify-faunadb-example +``` -9. Bootstrap your FaunaDB collection and indexes +### 3. Install NPM dependencies +```bash +npm install +``` - ```bash - npm run bootstrap - ``` +### 4. Sign up for a FaunaDB account +https://dashboard.fauna.com/accounts/register + +### 5. Create a database +In the Fauna Cloud Console: + - Click “New Database” + - Enter “Netlify” as the “Database Name” + - Click “Save” + +### 6. Create a database access key +In the Fauna Cloud Console: + - Click “Security” in the left navigation + - Click “New Key” + - Make sure that the “Database” field is set to “Netlify” + - Make sure that the “Role” field is set to “Admin” + - Enter “Netlify” as the “Key Name” + - Click “Save” + +### 7. Configure database access +Copy the secret key. **You won't get to see it again!** + +Create a `.env` file in the top level of the repo. You can store your Fauna +server key here as an environment variable and `netlify dev` will load it +automatically: + +```bash +# .env +FAUNADB_SERVER_SECRET="SECRET_KEY_HERE" +``` -10. Start developing! +### 8. Bootstrap your FaunaDB collection and indexes +```bash +# create, import Fauna database schema +npm run bootstrap +``` - ```bash - netlify dev - ``` +### 9. Start developing! +```bash +# automatically loads variables from your local .env file +netlify dev +``` ## TLDR; Quick Deploy