diff --git a/next.config.js b/next.config.js index 26e36268..74c57e90 100644 --- a/next.config.js +++ b/next.config.js @@ -14,6 +14,7 @@ module.exports = withBundleAnalyzer({ publicRuntimeConfig: { nodeEnv: process.env.NODE_ENV || 'development', apiUrl: `${process.env.BASE_PATH || ''}/api/v1`, + apiBaseUrl: `${process.env.API_BASE_URL || ''}/api/v1`, basePath: process.env.BASE_PATH || '', npmVersion: process.env.npm_package_version || '0.0.0', }, diff --git a/pages/api/v1.tsx b/pages/api/v1.tsx index 3ef3309b..8340e688 100644 --- a/pages/api/v1.tsx +++ b/pages/api/v1.tsx @@ -5,7 +5,7 @@ import getConfig from 'next/config'; import Cors from 'micro-cors'; const { publicRuntimeConfig } = getConfig(); -const { apiUrl } = publicRuntimeConfig; +const { apiBaseUrl } = publicRuntimeConfig; const cors = Cors({ origin: true, @@ -19,7 +19,7 @@ const apolloServer = new ApolloServer({ }, }); -const handler = apolloServer.createHandler({ path: apiUrl }); +const handler = apolloServer.createHandler({ path: apiBaseUrl }); export const config = { api: {