File tree Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Expand file tree Collapse file tree 4 files changed +40
-2
lines changed Original file line number Diff line number Diff line change
1
+ test /sampleApp /node_modules /
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ function run (args) {
134
134
startChildProcess ( ) ;
135
135
136
136
//
137
- // Read input from stdin
137
+ // Read input from stdin
138
138
//
139
139
var stdin = process . stdin ;
140
140
@@ -170,7 +170,8 @@ function run (args) {
170
170
} ) ;
171
171
} ;
172
172
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 ; }
174
175
175
176
function help ( ) {
176
177
print
@@ -237,6 +238,10 @@ function help () {
237
238
( " -V|--verbose" )
238
239
( " Show extra DEBUG messages" )
239
240
( "" )
241
+ ( "Options available after start:" )
242
+ ( "rs - restart process." )
243
+ ( " Useful for restarting supervisor eaven if no file has changed." )
244
+ ( "" )
240
245
( "Examples:" )
241
246
( " supervisor myapp.js" )
242
247
( " supervisor myapp.coffee" )
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ } ) ;
You can’t perform that action at this time.
0 commit comments