Skip to content

Commit 591233a

Browse files
evanevanhgs
authored andcommitted
feat: integrate version.json for dynamic versioning and replace REACT_APP_GIT_VERSION with versionData.version in endpoints
1 parent 20d7fe7 commit 591233a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/endpoints.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import axios from "axios";
2+
import versionData from '@/version.json';
23

34
export const API_BASE_URL: string = process.env.NEXT_PUBLIC_API_URL ?? '';
45
export const FRONTEND_URL: string = process.env.NEXT_PUBLIC_FRONT_URL ?? '';
56
export const API_MQTT_WSS: string = process.env.NEXT_PUBLIC_MQTT_URL ?? '';
67
export const API_MQTT_USER: string = process.env.NEXT_PUBLIC_API_MQTT_USER ?? '';
78
export const API_MQTT_PASSWORD: string = process.env.NEXT_PUBLIC_API_MQTT_PASSWORD ?? '';
8-
export const REACT_APP_GIT_VERSION: string = process.env.NEXT_PUBLIC_REACT_APP_GIT_VERSION ?? '';
9+
export const REACT_APP_GIT_VERSION: string = versionData.version;
910
// console.log(API_BASE_URL)
1011

1112
const url = (path: string) => `${API_BASE_URL}${path}`

version.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "2.1.6",
3+
"gitVersion": "2.1.6"
4+
}

0 commit comments

Comments
 (0)