soul-cli 0.7.7 → 0.7.8

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/README.md CHANGED
@@ -34,6 +34,7 @@ Options:
34
34
  -p, --port Port to listen on [number]
35
35
  -r, --rate-limit-enabled Enable rate limiting [boolean]
36
36
  -c, --cors CORS whitelist origins [string]
37
+ --env, --envpath Path to load .env file [string]
37
38
  -a, --auth Enable authentication and authorization [boolean]
38
39
 
39
40
  --iuu, --initialuserusername Initial user username [string]
@@ -42,8 +43,8 @@ Options:
42
43
  --ts, --tokensecret Token Secret [string]
43
44
  --atet, --accesstokenexpirationtime Access Token Expiration Time (Default: 5H) [string]
44
45
  --rtet, --refreshtokenexpirationtime Refresh Token Expiration Time (Default: 1D) [string]
45
- -S, --studio Start Soul Studio in parallel
46
- --help Show help
46
+ -S, --studio Start Soul Studio in parallel
47
+ --help Show help
47
48
 
48
49
  ```
49
50
 
@@ -98,6 +99,20 @@ soul -d foobar.db updatesuperuser --id=1 --is_superuser=true // Upgrade the user
98
99
  soul -d foobar.db updatesuperuser --id=1 --is_superuser=false // Revoke the superuser role from the superuser with ID 1
99
100
  ```
100
101
 
102
+ ### Passing Custom Path for .env File
103
+
104
+ There might be cases where you want to pass a custom path for your `.env` file. For this, you can use the `--env` flag when running the `soul` command, providing the absolute file path of your `.env` file.
105
+
106
+ ```shell
107
+ soul -d foobar.db --env=/Users/Documents/Projects/React-Project/.env
108
+ ```
109
+
110
+ NOTE:
111
+
112
+ - You should pass an absolute file path of the .env file.
113
+ - Relative paths are not allowed.
114
+ - Don't forget to include the .env file in the specified path.
115
+
101
116
  ## Documentation
102
117
 
103
118
  API documentation is available while the project is running at [http://localhost:8000/api/docs](http://localhost:8000/api/docs)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soul-cli",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "A SQLite REST and Realtime server",
5
5
  "main": "src/server.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -46,6 +46,12 @@ if (process.env.NO_CLI !== 'true') {
46
46
  type: 'string',
47
47
  demandOption: false,
48
48
  })
49
+ .options('env', {
50
+ alias: 'envpath',
51
+ describe: 'Environment variable file path to load',
52
+ type: 'string',
53
+ demandOption: false,
54
+ })
49
55
  .options('a', {
50
56
  alias: 'auth',
51
57
  describe: 'Enable authentication and authorization',
@@ -6,7 +6,7 @@ const { yargs } = require('../cli');
6
6
 
7
7
  const { argv } = yargs;
8
8
 
9
- dotenv.config({ path: path.join(__dirname, '../../.env') });
9
+ dotenv.config({ path: argv.envpath || path.join(__dirname, '../../.env') });
10
10
 
11
11
  const envVarsSchema = Joi.object()
12
12
  .keys({