Skip to content

Commit 1de7d1d

Browse files
committed
Added test file
Removed extra breaks in help message
1 parent a43fb40 commit 1de7d1d

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/sampleApp/node_modules/

lib/supervisor.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function run (args) {
134134
startChildProcess();
135135

136136
//
137-
// Read input from stdin
137+
// Read input from stdin
138138
//
139139
var stdin = process.stdin;
140140

@@ -170,7 +170,8 @@ function run (args) {
170170
});
171171
};
172172

173-
function print (m, n) { console.log(m+(!n?"\n":"")); return print; }
173+
// function print (m, n) { console.log(m+(!n?"\n":"")); return print; }
174+
function print (m, n) { console.log(m); return print; }
174175

175176
function help () {
176177
print
@@ -237,6 +238,10 @@ function help () {
237238
(" -V|--verbose")
238239
(" Show extra DEBUG messages")
239240
("")
241+
("Options available after start:")
242+
("rs - restart process.")
243+
(" Useful for restarting supervisor eaven if no file has changed.")
244+
("")
240245
("Examples:")
241246
(" supervisor myapp.js")
242247
(" supervisor myapp.coffee")

test/sampleApp/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "cors-demo",
3+
"version": "0.0.1",
4+
"description": "Cors demo",
5+
"main": "server.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "Petru Isfan",
10+
"license": "Apache2",
11+
"dependencies": {
12+
"express": "^4.12.3"
13+
}
14+
}

test/sampleApp/server.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
var express = require('express');
3+
var app = express();
4+
5+
app.get('/', function (req, res) {
6+
//
7+
// CORS
8+
//
9+
res.setHeader("Access-Control-Allow-Origin", "http://cors-client.com");
10+
res.send('Hello World!')
11+
});
12+
13+
var server = app.listen(3000, function () {
14+
var host = server.address().address;
15+
var port = server.address().port;
16+
17+
console.log('Example app listening at http://%s:%s', host, port);
18+
});

0 commit comments

Comments
 (0)