refactor: Redo env var names to work with vite. Add version
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m1s

This commit is contained in:
2024-06-09 08:53:34 -04:00
parent 7fc640d679
commit 2a949d771a
13 changed files with 835 additions and 807 deletions

View File

@@ -14,20 +14,25 @@ import type { Router } from 'vue-router';
const client = new Client();
let APPWRITE_API_ENDPOINT, APPWRITE_API_PROJECT;
let VITE_APPWRITE_API_ENDPOINT, VITE_APPWRITE_API_PROJECT;
// Private self-hosted appwrite
if (process.env.APPWRITE_API_ENDPOINT && process.env.APPWRITE_API_PROJECT) {
APPWRITE_API_ENDPOINT = process.env.APPWRITE_API_ENDPOINT;
APPWRITE_API_PROJECT = process.env.APPWRITE_API_PROJECT;
if (
process.env.VITE_APPWRITE_API_ENDPOINT &&
process.env.VITE_APPWRITE_API_PROJECT
) {
VITE_APPWRITE_API_ENDPOINT = process.env.VITE_APPWRITE_API_ENDPOINT;
VITE_APPWRITE_API_PROJECT = process.env.VITE_APPWRITE_API_PROJECT;
} else if (process.env.DEV) {
APPWRITE_API_ENDPOINT = 'http://localhost:4000/api/v1';
APPWRITE_API_PROJECT = '65ede55a213134f2b688';
VITE_APPWRITE_API_ENDPOINT = 'http://localhost:4000/api/v1';
VITE_APPWRITE_API_PROJECT = '65ede55a213134f2b688';
} else {
APPWRITE_API_ENDPOINT = 'https://appwrite.oys.undock.ca/v1';
APPWRITE_API_PROJECT = 'bab';
VITE_APPWRITE_API_ENDPOINT = 'https://appwrite.oys.undock.ca/v1';
VITE_APPWRITE_API_PROJECT = 'bab';
}
client.setEndpoint(APPWRITE_API_ENDPOINT).setProject(APPWRITE_API_PROJECT);
client
.setEndpoint(VITE_APPWRITE_API_ENDPOINT)
.setProject(VITE_APPWRITE_API_PROJECT);
const pwresetUrl = process.env.DEV
? 'http://localhost:4000/pwreset'