diff --git a/discord-bot/.env.example b/discord-bot/.env.example index 0e069d9..50f57d4 100644 --- a/discord-bot/.env.example +++ b/discord-bot/.env.example @@ -5,6 +5,8 @@ DATA_API_URI=http://127.0.0.1:8181/v1/discordbot DATA_API_AUTH_USERNAME=cassandra DATA_API_AUTH_PASSWORD=cassandra DATA_API_AUTH_URL=http://localhost:8081/v1/auth +#Uncomment the following to enable API tables +#DATA_API_TABLES=true #Fill the ASTRA DB related details only when IS_ASTRA is set to 'true' #IS_ASTRA=true diff --git a/discord-bot/README.md b/discord-bot/README.md index 3d072c6..e9dd87d 100644 --- a/discord-bot/README.md +++ b/discord-bot/README.md @@ -46,15 +46,4 @@ Below is a screenshot demonstrating executing each of the commands. ![image](https://user-images.githubusercontent.com/1620265/213293087-53505a73-3038-4db8-b21b-d9149a5396ed.png) -Anytime you add or update commands in the command folder, run step 3 again. - -## With tables - -Create table: - -``` -CREATE TABLE bots ( - "_id" text, - name text, - PRIMARY KEY ("_id")); -``` \ No newline at end of file +Anytime you add or update commands in the command folder, run step 3 again. \ No newline at end of file diff --git a/netlify-functions-ecommerce/.env.example b/netlify-functions-ecommerce/.env.example index c896178..e39c989 100644 --- a/netlify-functions-ecommerce/.env.example +++ b/netlify-functions-ecommerce/.env.example @@ -3,14 +3,16 @@ # false - if not connecting to an AstraDB and connecting to a local/remote jsonapi instead IS_ASTRA= -#Fill the JSON API related details only when IS_ASTRA is set to 'false' -#Local JSON API URL for example: http://127.0.0.1:8181/v1/ecommerce_test where 'ecommerce_test' is the keyspace name +#Fill the Data API related details only when IS_ASTRA is set to 'false' +#Local Data API URL for example: http://127.0.0.1:8181/v1/ecommerce_test where 'ecommerce_test' is the keyspace name DATA_API_URI=http://127.0.0.1:8181/v1/ecommerce_test #Auth URL for example: http://127.0.0.1:8081/v1/auth DATA_API_AUTH_URL=http://127.0.0.1:8081/v1/auth #Auth username and password DATA_API_AUTH_USERNAME=cassandra DATA_API_AUTH_PASSWORD=cassandra +#Uncomment the following to enable API tables +#DATA_API_TABLES=true #Fill the ASTRA DB related details only when IS_ASTRA is set to 'true' #Astra DB API URL diff --git a/netlify-functions-ecommerce/README.md b/netlify-functions-ecommerce/README.md index eda3641..d9d2b8a 100644 --- a/netlify-functions-ecommerce/README.md +++ b/netlify-functions-ecommerce/README.md @@ -12,7 +12,7 @@ Other tools include: Make sure you have a local stargate instance running as described on the [main page](../README.md) of this repo. ## Running This Example -### Setting up .env file to run against JSON API +### Setting up .env file to run against Data API 1. Copy the `.env.example` file to `.env` and fill in the values for the environment variables. 2. Set `IS_ASTRA` to `false` 3. Set `DATA_API_URI` to `http://127.0.0.1:8181/v1/ecommerce_test` @@ -20,6 +20,7 @@ Make sure you have a local stargate instance running as described on the [main p 5. Set `DATA_API_AUTH_USERNAME` to `cassandra` 6. Set `DATA_API_AUTH_PASSWORD` to `cassandra` 7. Remove `ASTRA_DB_ID`, `ASTRA_DB_REGION`, `ASTRA_DB_KEYSPACE`, `ASTRA_DB_APPLICATION_TOKEN` +8. (Optional) Set `DATA_API_TABLES=true` to make stargate-mongoose set the `Feature-Flag-tables` headers to enable API tables ### Setting up .env file to run against AstraDB 1. Copy the `.env.example` file to `.env` and fill in the values for the environment variables. @@ -34,7 +35,7 @@ Make sure you have a local stargate instance running as described on the [main p 1. Run `npm install` 2. Run `npm run seed` to create all collections and insert sample data 3. Run `npm run build` to compile the frontend -4. (Optional) set `STRIPE_SECRET_KEY` to a test Stripe API key in your `.env` file. This will allow you to enable Stripe checkout. +4. (Optional) set `STRIPE_SECRET_KEY` to a test Stripe API key in your `.env` file. This will allow you to enable Stripe checkout. Or set `STRIPE_SECRET_KEY` to `test` to skip Stripe scheckout 5. Run `npm start` Run `npm run test:smoke` to run a smoke test against `http://127.0.0.1:8888` that creates a cart using [Axios](https://masteringjs.io/axios). 6. Visit `http://127.0.0.1:8888/` to see the UI @@ -70,33 +71,4 @@ Using test 8 passing (112ms) -``` - - -## With tables - -``` -CREATE TABLE products ( - "_id" text, - name text, - price decimal, - image text, - description text, - PRIMARY KEY ("_id")); - -CREATE TABLE orders ( - "_id" text, - total decimal, - name text, - "paymentMethod" text, - items text, - PRIMARY KEY ("_id")); - -CREATE TABLE carts ( - "_id" text, - items text, - "orderId" text, - total decimal, - "stripeSessionId" text, - PRIMARY KEY ("_id")); ``` \ No newline at end of file diff --git a/typescript-express-reviews/.env.example b/typescript-express-reviews/.env.example index 0902ac1..a12b32d 100644 --- a/typescript-express-reviews/.env.example +++ b/typescript-express-reviews/.env.example @@ -11,6 +11,8 @@ DATA_API_AUTH_URL=http://127.0.0.1:8081/v1/auth #Auth username and password DATA_API_AUTH_USERNAME=cassandra DATA_API_AUTH_PASSWORD=cassandra +#Uncomment the following to enable API tables +#DATA_API_TABLES=true #Fill the ASTRA DB related details only when IS_ASTRA is set to 'true' #Astra DB API URL