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.
Files changed (3) hide show
  1. package/.env +1 -0
  2. package/package.json +1 -1
  3. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexforge-cli",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Custom Deployment CLI for NexForge",
5
5
  "main": "index.js",
6
6
  "bin": {
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-lbxg.onrender.com/api"
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) => {