You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,41 @@ There are [several examples][1] designed to test the fault tolerance of forever.
98
98
$ forever -m 5 examples/error-on-timer.js
99
99
```
100
100
101
+
### JSON Configuration Files
102
+
103
+
In addition to passing forever the path to a script (along with accompanying options, described above), you may also pass forever the path to a JSON file, in which these options are defined. For example, consider an application with the following file structure:
104
+
105
+
```
106
+
.
107
+
├── forever
108
+
│ └── development.json
109
+
└── index.js
110
+
111
+
// forever/development.json
112
+
{
113
+
// Comments are supported
114
+
"uid": "app",
115
+
"append": true,
116
+
"watch": true,
117
+
"script": "index.js",
118
+
"sourceDir": "/home/myuser/app"
119
+
}
120
+
```
121
+
122
+
This application could be started with forever, as shown below:
123
+
124
+
```bash
125
+
$ forever start ./forever/development.json
126
+
```
127
+
128
+
Absolute paths to such configuration files are also supported:
**Note:** Forever parses JSON configuration files using [shush](https://github.com/krakenjs/shush), allowing the use of in-line comments within such files.
135
+
101
136
### Using In Your Code
102
137
The forever module exposes some useful methods to use in your code. Each method returns an instance of an EventEmitter which emits when complete. See the [forever cli commands][2] for sample usage.
0 commit comments