From d6718cc54552b2cfe17f1bf6e13f646f876bbe50 Mon Sep 17 00:00:00 2001 From: Elias Schneider Date: Mon, 25 Apr 2022 17:16:17 +0200 Subject: [PATCH] renamed env variable --- .env.example | 2 +- .setup/services/api.service.ts | 2 +- .setup/services/aw.service.ts | 2 +- README.md | 2 +- src/utils/appwrite.util.ts | 2 +- src/utils/appwriteServer.util.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 7f6281d..6ea1638 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ APPWRITE_FUNCTION_API_KEY= # IMPORTANT If you're running the website inside docker and your Appwrite instance runs on localhost host, # use host.docker.internal instead of localhost -APPWRITE_HOST=http://host.docker.internal/v1 +NEXT_PUBLIC_APPWRITE_HOST=http://host.docker.internal/v1 # Must be the same as in the _APP_STORAGE_LIMIT in the Appwrite env file NEXT_PUBLIC_MAX_FILE_SIZE=300000000 \ No newline at end of file diff --git a/.setup/services/api.service.ts b/.setup/services/api.service.ts index 5a87bb4..23557f5 100644 --- a/.setup/services/api.service.ts +++ b/.setup/services/api.service.ts @@ -2,7 +2,7 @@ import axios from "axios"; const api = () => axios.create({ - baseURL: process.env["APPWRITE_HOST"], + baseURL: process.env["NEXT_PUBLIC_APPWRITE_HOST"], headers: { cookie: `a_session_console=${process.env["APPWRITE_USER_TOKEN"]}`, }, diff --git a/.setup/services/aw.service.ts b/.setup/services/aw.service.ts index 1e053d2..2418aff 100644 --- a/.setup/services/aw.service.ts +++ b/.setup/services/aw.service.ts @@ -3,7 +3,7 @@ const aw = () => { let client = new sdk.Client(); client - .setEndpoint(process.env["APPWRITE_HOST"]) + .setEndpoint(process.env["NEXT_PUBLIC_APPWRITE_HOST"]) .setProject("pingvin-share") .setKey(process.env["APPWRITE_API_KEY"]) .setSelfSigned(); diff --git a/README.md b/README.md index 3070333..f35c646 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ To set up the frontend of Pingvin Share follow these steps. 1. Go to your Appwrite console, visit "API Keys" and copy the "Functions API Key" secret to your clipboard. 2. Rename the `.env.example` file to `.env` 3. Paste the key in the `.env` file -4. Change `APPWRITE_HOST` in the `.env` file to the host where your Appwrite instance runs +4. Change `NEXT_PUBLIC_APPWRITE_HOST` in the `.env` file to the host where your Appwrite instance runs 5. Change `NEXT_PUBLIC_MAX_FILE_SIZE` in the `.env` file to the max file size limit you want Start the frontend: diff --git a/src/utils/appwrite.util.ts b/src/utils/appwrite.util.ts index 2cc12b4..b940db4 100644 --- a/src/utils/appwrite.util.ts +++ b/src/utils/appwrite.util.ts @@ -3,7 +3,7 @@ import { Appwrite } from "appwrite"; // SDK for client side (browser) const aw = new Appwrite(); -aw.setEndpoint(process.env["APPWRITE_HOST"] as string) +aw.setEndpoint(process.env["NEXT_PUBLIC_APPWRITE_HOST"] as string) .setProject("pingvin-share"); export default aw; diff --git a/src/utils/appwriteServer.util.ts b/src/utils/appwriteServer.util.ts index 29aa101..b6916d6 100644 --- a/src/utils/appwriteServer.util.ts +++ b/src/utils/appwriteServer.util.ts @@ -4,7 +4,7 @@ import sdk from "node-appwrite"; const client = new sdk.Client(); client - .setEndpoint(process.env["APPWRITE_HOST"] as string) + .setEndpoint(process.env["NEXT_PUBLIC_APPWRITE_HOST"] as string) .setProject("pingvin-share") .setKey(process.env["APPWRITE_FUNCTION_API_KEY"] as string);