Skip to content

Commit 0e4daf9

Browse files
committed
refactor: update environment variable names for clarity
1 parent 3229159 commit 0e4daf9

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

packages/mosip-mock/src/constants.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { cleanEnv, str } from "envalid";
22

33
export const env = cleanEnv(process.env, {
4-
OPENCRVS_MOSIP_GATEWAY_URL: str({
4+
OPENCRVS_MOSIP_SERVER_URL: str({
55
devDefault: "http://localhost:2024/webhooks/mosip",
6+
desc: "The URL where @opencrvs/mosip/server receives webhooks from MOSIP",
67
}),
78
});

packages/mosip-mock/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const sendNid = async ({
1717
trackingId: string;
1818
}) => {
1919
const nid = await createNid();
20-
const response = await fetch(env.OPENCRVS_MOSIP_GATEWAY_URL, {
20+
const response = await fetch(env.OPENCRVS_MOSIP_SERVER_URL, {
2121
method: "POST",
2222
body: JSON.stringify({ nid, token, eventId, trackingId }),
2323
headers: {

packages/server/src/constants.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { cleanEnv, str, num } from "envalid";
22

33
export const env = cleanEnv(process.env, {
44
PORT: num({ default: 2024 }),
5-
MOSIP_RECEIVE_WEBHOOK_URL: str({
5+
MOSIP_WEBHOOK_URL: str({
66
devDefault: "http://localhost:20240/webhooks/opencrvs",
7+
desc: "The URL where MOSIP receives webhooks from OpenCRVS",
78
}),
89
OPENCRVS_GRAPHQL_GATEWAY_URL: str({
910
devDefault: "http://localhost:7070/graphql",
11+
desc: "The URL of the OpenCRVS GraphQL Gateway",
1012
}),
1113
});

packages/server/src/mosip-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const postRecord = async ({
1717
};
1818
token: string;
1919
}) => {
20-
const response = await fetch(env.MOSIP_RECEIVE_WEBHOOK_URL, {
20+
const response = await fetch(env.MOSIP_WEBHOOK_URL, {
2121
method: "POST",
2222
body: JSON.stringify({ event, token }),
2323
headers: {

0 commit comments

Comments
 (0)