fix env variable
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 4m52s
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 4m52s
This commit is contained in:
@@ -11,8 +11,7 @@ interface NextContext {
|
||||
const environment = process.env.NODE_ENV || "development";
|
||||
|
||||
const isValidApiKey = (apiKey: string): boolean => {
|
||||
console.log(process.env);
|
||||
const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN;
|
||||
const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN || process.env.API_TOKEN;
|
||||
|
||||
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
|
||||
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
|
||||
fetchAPI: { Response },
|
||||
|
||||
Reference in New Issue
Block a user