nexforge-cli 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +1 -0
- package/package.json +1 -1
- package/src/config.js +5 -1
package/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
API_BASE_URL=https://nexforge-backend-x2j1.onrender.com/api
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -2,11 +2,15 @@ import axios from 'axios'
|
|
|
2
2
|
import fs from 'fs'
|
|
3
3
|
import path from 'path'
|
|
4
4
|
import os from 'os'
|
|
5
|
+
import dotenv from 'dotenv'
|
|
6
|
+
|
|
7
|
+
// Load environment variables from the .env file located at the root of the CLI project
|
|
8
|
+
dotenv.config({ path: path.join(path.dirname(new URL(import.meta.url).pathname), '..', '.env').substring(process.platform === 'win32' ? 1 : 0) })
|
|
5
9
|
|
|
6
10
|
export const CONFIG_DIR = path.join(os.homedir(), ".nexforge")
|
|
7
11
|
export const CONFIG_FILE = path.join(CONFIG_DIR, "config.json")
|
|
8
12
|
|
|
9
|
-
export const API_BASE_URL = "https://nexforge-
|
|
13
|
+
export const API_BASE_URL = process.env.API_BASE_URL || "https://nexforge-backend-x2j1.onrender.com/api"
|
|
10
14
|
|
|
11
15
|
// Intercept axios requests to attach the CLI Token if it exists
|
|
12
16
|
axios.interceptors.request.use((config) => {
|