diff --git a/packages/api-client/env.d.ts b/packages/api-client/env.d.ts new file mode 100644 index 0000000..872142a --- /dev/null +++ b/packages/api-client/env.d.ts @@ -0,0 +1,6 @@ +namespace NodeJS { + interface ProcessEnv { + NODE_ENV: string; + NEXT_PUBLIC_BASE_API_URL: string; + } +} diff --git a/packages/api-client/helpers.ts b/packages/api-client/helpers.ts index 666d399..afc847f 100644 --- a/packages/api-client/helpers.ts +++ b/packages/api-client/helpers.ts @@ -1 +1,2 @@ -export const apiURL = (value: string) => process.env.NEXT_PUBLIC_BASE_API_URL + value; +const PUBLIC_BASE_API_URL = process.env.NEXT_PUBLIC_BASE_API_URL ?? '/api'; +export const apiURL = (value: string) => PUBLIC_BASE_API_URL + value; diff --git a/packages/api-client/tsconfig.json b/packages/api-client/tsconfig.json index f5b8565..a5da965 100644 --- a/packages/api-client/tsconfig.json +++ b/packages/api-client/tsconfig.json @@ -10,7 +10,7 @@ "noFallthroughCasesInSwitch": true }, "files": [], - "include": [], + "include": ["env.d.ts"], "references": [ { "path": "./tsconfig.lib.json" diff --git a/packages/graphql/schema/index.ts b/packages/graphql/schema/index.ts index 7a3b227..07730c8 100644 --- a/packages/graphql/schema/index.ts +++ b/packages/graphql/schema/index.ts @@ -1,3 +1,5 @@ +import { GraphQLSchema } from 'graphql/type'; + import { builder } from '../builder'; import '../types'; import './environment'; @@ -6,4 +8,5 @@ import './service'; import './serviceVersion'; import './version'; -export default builder.toSchema(); +const schema: GraphQLSchema = builder.toSchema(); +export default schema; diff --git a/packages/prisma/env.d.ts b/packages/prisma/env.d.ts new file mode 100644 index 0000000..769675c --- /dev/null +++ b/packages/prisma/env.d.ts @@ -0,0 +1,5 @@ +namespace NodeJS { + interface ProcessEnv { + NODE_ENV: string; + } +} diff --git a/packages/prisma/tsconfig.json b/packages/prisma/tsconfig.json index f5b8565..a5da965 100644 --- a/packages/prisma/tsconfig.json +++ b/packages/prisma/tsconfig.json @@ -10,7 +10,7 @@ "noFallthroughCasesInSwitch": true }, "files": [], - "include": [], + "include": ["env.d.ts"], "references": [ { "path": "./tsconfig.lib.json"