Comparing version 0.15.0 to 0.15.1
@@ -212,2 +212,3 @@ /* | ||
], | ||
specialKeys = ['script', 'args'], | ||
configs; | ||
@@ -225,3 +226,6 @@ | ||
.reduce(function (acc, key) { | ||
if (~configKeys.indexOf(key) || key === 'script') { acc[key] = conf[key]; } | ||
if (~configKeys.indexOf(key) || ~specialKeys.indexOf(key)) { | ||
acc[key] = conf[key]; | ||
} | ||
return acc; | ||
@@ -228,0 +232,0 @@ }, {}); |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple CLI tool for ensuring that a given node script runs continuously (i.e. forever)", | ||
"version": "0.15.0", | ||
"version": "0.15.1", | ||
"author": "Charlie Robbins <charlie.robbins@gmail.com>", | ||
@@ -8,0 +8,0 @@ "maintainers": [ |
@@ -1,3 +0,8 @@ | ||
# forever [![Build Status](https://api.travis-ci.org/foreverjs/forever.svg)](https://travis-ci.org/foreverjs/forever) [![Inline docs](http://inch-ci.org/github/foreverjs/forever.svg?branch=master)](http://inch-ci.org/github/foreverjs/forever) | ||
# forever | ||
[![Version npm](https://img.shields.io/npm/v/forever.svg?style=flat-square)](https://www.npmjs.com/package/forever)[![npm Downloads](https://img.shields.io/npm/dm/forever.svg?style=flat-square)](https://www.npmjs.com/package/forever)[![Build Status](https://img.shields.io/travis/foreverjs/forever/master.svg?style=flat-square)](https://travis-ci.org/foreverjs/forever)[![Dependencies](https://img.shields.io/david/foreverjs/forever.svg?style=flat-square)](https://david-dm.org/foreverjs/forever)[![Inline docs](http://inch-ci.org/github/foreverjs/forever.svg?branch=master)](http://inch-ci.org/github/foreverjs/forever) | ||
[![NPM](https://nodei.co/npm/forever.png?downloads=true&downloadRank=true)](https://nodei.co/npm/forever/) | ||
A simple CLI tool for ensuring that a given script runs continuously (i.e. forever). | ||
@@ -142,18 +147,19 @@ | ||
[ | ||
{ | ||
// App1 | ||
"uid": "app1", | ||
"append": true, | ||
"watch": true, | ||
"script": "index.js", | ||
"sourceDir": "/home/myuser/app1" | ||
}, | ||
{ | ||
// App2 | ||
"uid": "app2", | ||
"append": true, | ||
"watch": true, | ||
"script": "index.js", | ||
"sourceDir": "/home/myuser/app2" | ||
} | ||
{ | ||
// App1 | ||
"uid": "app1", | ||
"append": true, | ||
"watch": true, | ||
"script": "index.js", | ||
"sourceDir": "/home/myuser/app1" | ||
}, | ||
{ | ||
// App2 | ||
"uid": "app2", | ||
"append": true, | ||
"watch": true, | ||
"script": "index.js", | ||
"sourceDir": "/home/myuser/app2", | ||
"args": ["--port", "8081"] | ||
} | ||
] | ||
@@ -160,0 +166,0 @@ ``` |
@@ -13,2 +13,4 @@ /* | ||
vows = require('vows'), | ||
async = require('utile').async, | ||
request = require('request'), | ||
forever = require('../../lib/forever'), | ||
@@ -36,2 +38,18 @@ runCmd = require('../helpers').runCmd; | ||
}).addBatch({ | ||
"When the script is running": { | ||
"request to both ports": { | ||
topic: function () { | ||
async.parallel({ | ||
one: async.apply(request, { uri: 'http://localhost:8080', json: true }), | ||
two: async.apply(request, { uri: 'http://localhost:8081', json: true }) | ||
}, this.callback); | ||
}, | ||
"should respond correctly": function (err, results) { | ||
assert.isNull(err); | ||
assert.isTrue(!results.one[1].p); | ||
assert.equal(results.two[1].p, 8081); | ||
} | ||
} | ||
} | ||
}).addBatch({ | ||
"When the script is running" : { | ||
@@ -38,0 +56,0 @@ "try to stopall" : { |
@@ -5,3 +5,3 @@ var util = require('util'), | ||
var port = argv.p || argv.port || 80; | ||
var port = argv.p || argv.port || 8080; | ||
@@ -11,3 +11,3 @@ http.createServer(function (req, res) { | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
res.write('hello, i know nodejitsu.'); | ||
res.write(JSON.stringify(argv)); | ||
res.end(); | ||
@@ -14,0 +14,0 @@ }).listen(port); |
{ | ||
"uid": "server", | ||
"append": true, | ||
"script": "server.js", | ||
"sourceDir": "./test/fixtures" | ||
"uid": "server", | ||
"append": true, | ||
"script": "server.js", | ||
"sourceDir": "./test/fixtures" | ||
} |
[ | ||
{ | ||
"uid": "server1", | ||
"append": true, | ||
"script": "server.js", | ||
"sourceDir": "./test/fixtures" | ||
}, | ||
{ | ||
"uid": "server2", | ||
"append": true, | ||
"script": "server2.js", | ||
"sourceDir": "./test/fixtures" | ||
} | ||
{ | ||
"uid": "server1", | ||
"append": true, | ||
"script": "server.js", | ||
"sourceDir": "./test/fixtures" | ||
}, | ||
{ | ||
"uid": "server2", | ||
"append": true, | ||
"script": "server.js", | ||
"sourceDir": "./test/fixtures", | ||
"args": ["-p", 8081] | ||
} | ||
] |
@@ -25,3 +25,3 @@ /* | ||
topic: function () { | ||
request('http://127.0.0.1:' + port, this.callback); | ||
request({ uri: 'http://127.0.0.1:' + port, json: true }, this.callback); | ||
}, | ||
@@ -31,3 +31,3 @@ "should respond with `i know nodejitsu`": function (err, res, body) { | ||
assert.equal(res.statusCode, 200); | ||
assert.equal(body, 'hello, i know nodejitsu.'); | ||
assert.equal(body.port, port); | ||
}, | ||
@@ -34,0 +34,0 @@ "stop the child process": function () { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169277
2355
248
8
34