fix env variable
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 4m52s

This commit is contained in:
2025-12-06 21:36:45 -05:00
parent f035c2e746
commit 8bda185848

View File

@@ -11,8 +11,7 @@ interface NextContext {
const environment = process.env.NODE_ENV || "development"; const environment = process.env.NODE_ENV || "development";
const isValidApiKey = (apiKey: string): boolean => { const isValidApiKey = (apiKey: string): boolean => {
console.log(process.env); const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN || process.env.API_TOKEN;
const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN;
return apiKey === envApiKey; return apiKey === envApiKey;
}; };
@@ -59,7 +58,10 @@ const { handleRequest } = createYoga<NextContext>({
}), }),
// While using Next.js file convention for routing, we need to configure Yoga to use the correct endpoint // While using Next.js file convention for routing, we need to configure Yoga to use the correct endpoint
graphqlEndpoint: process.env.NEXT_PUBLIC_GRAPHQL_URL || "/api/graphql", graphqlEndpoint:
process.env.NEXT_PUBLIC_GRAPHQL_URL ||
process.env.GRAPHQL_UR ||
"/api/graphql",
// Yoga needs to know how to create a valid Next response // Yoga needs to know how to create a valid Next response
fetchAPI: { Response }, fetchAPI: { Response },