Compare commits

...

3 Commits

Author SHA1 Message Date
98f954aa82 update api token
All checks were successful
Main / build-and-push-docker-image (20.x) (pull_request) Successful in 7m57s
2025-12-06 22:22:33 -05:00
a0107eeb27 added api token to urql and env example 2025-12-06 20:32:09 -05:00
74d32d518e added new env variable 2025-12-05 17:11:04 -05:00
5 changed files with 11 additions and 4 deletions

View File

@@ -8,4 +8,5 @@ SERVER_HOST=localhost
SERVER_PORT=3000 SERVER_PORT=3000
BOT_ADMINS=[1] BOT_ADMINS=[1]
GROUP_IDS=- GROUP_IDS=-
GRAPHQL_URL=http://localhost:3000/api/graphql GRAPHQL_URL=http://localhost:3000/api/graphql
GRAPHQL_API_TOKEN="token-here"

View File

@@ -13,6 +13,7 @@ services:
- SERVER_PORT=${SERVER_PORT} - SERVER_PORT=${SERVER_PORT}
- BOT_ADMINS=${BOT_ADMINS} - BOT_ADMINS=${BOT_ADMINS}
- GROUP_IDS=${GROUP_IDS} - GROUP_IDS=${GROUP_IDS}
- GRAPHQL_URL=${GRAPHQL_URL}
ports: ports:
- "3000:80" - "3000:80"
volumes: volumes:

View File

@@ -14,5 +14,6 @@ services:
- SERVER_PORT=${SERVER_PORT} - SERVER_PORT=${SERVER_PORT}
- BOT_ADMINS=${BOT_ADMINS} - BOT_ADMINS=${BOT_ADMINS}
- GROUP_IDS=${GROUP_IDS} - GROUP_IDS=${GROUP_IDS}
- GRAPHQL_URL=${GRAPHQL_URL}
build: build:
context: . context: .

View File

@@ -14,5 +14,6 @@ services:
- SERVER_PORT=${SERVER_PORT} - SERVER_PORT=${SERVER_PORT}
- BOT_ADMINS=${BOT_ADMINS} - BOT_ADMINS=${BOT_ADMINS}
- GROUP_IDS=${GROUP_IDS} - GROUP_IDS=${GROUP_IDS}
- GRAPHQL_URL=${GRAPHQL_URL}
build: build:
context: . context: .

View File

@@ -2,9 +2,12 @@ import { Client, cacheExchange, fetchExchange } from "@urql/core";
const urql = new Client({ const urql = new Client({
url: process.env.GRAPHQL_URL || "", url: process.env.GRAPHQL_URL || "",
exchanges: [cacheExchange, fetchExchange] exchanges: [cacheExchange, fetchExchange],
fetchOptions: {
headers: {
"x-api-key": process.env?.GRAPHQL_API_TOKEN || ""
}
}
}); });
console.log(`GRAPHQL_URL`, process.env.GRAPHQL_URL);
export default urql; export default urql;