summaryrefslogtreecommitdiff
path: root/node_modules/forever/test/fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/forever/test/fixtures')
-rw-r--r--node_modules/forever/test/fixtures/log-on-interval.js3
-rw-r--r--node_modules/forever/test/fixtures/server.js16
-rw-r--r--node_modules/forever/test/fixtures/start-daemon.js16
3 files changed, 35 insertions, 0 deletions
diff --git a/node_modules/forever/test/fixtures/log-on-interval.js b/node_modules/forever/test/fixtures/log-on-interval.js
new file mode 100644
index 0000000..6b27652
--- /dev/null
+++ b/node_modules/forever/test/fixtures/log-on-interval.js
@@ -0,0 +1,3 @@
+setInterval(function () {
+ console.log('Logging at ' + Date.now());
+}, 100); \ No newline at end of file
diff --git a/node_modules/forever/test/fixtures/server.js b/node_modules/forever/test/fixtures/server.js
new file mode 100644
index 0000000..a386de2
--- /dev/null
+++ b/node_modules/forever/test/fixtures/server.js
@@ -0,0 +1,16 @@
+var util = require('util'),
+ http = require('http'),
+ argv = require('optimist').argv;
+
+var port = argv.p || argv.port || 80;
+
+http.createServer(function (req, res) {
+ console.log(req.method + ' request: ' + req.url);
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.write('hello, i know nodejitsu.');
+ res.end();
+}).listen(port);
+
+/* server started */
+util.puts('> hello world running on port ' + port);
+
diff --git a/node_modules/forever/test/fixtures/start-daemon.js b/node_modules/forever/test/fixtures/start-daemon.js
new file mode 100644
index 0000000..9bf8eb6
--- /dev/null
+++ b/node_modules/forever/test/fixtures/start-daemon.js
@@ -0,0 +1,16 @@
+/*
+ * start-daemon.js: Simple test fixture for spawning log-on-interval.js as a daemon
+ *
+ * (C) 2010 Nodejitsu Inc.
+ * MIT LICENCE
+ *
+ */
+
+var path = require('path'),
+ forever = require('../../lib/forever');
+
+var monitor = forever.startDaemon(path.join(__dirname, 'log-on-interval.js'));
+
+monitor.on('start', function () {
+ forever.startServer(monitor);
+});