Skip to content

Commit 79d91bd

Browse files
author
Nicola Greco
committed
Merge pull request #44 from nicola/bin_logs
Fixing debugging issues in executable, fix #43
2 parents 643c6de + 2b9b607 commit 79d91bd

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎bin/ldnode.js‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
var fs = require('fs');
2-
var debug = require('../logging').server;
3-
var ldnode = require('../index');
1+
#!/bin/env node
42

53
var argv = require('optimist')
64
.boolean('cors')
@@ -37,17 +35,22 @@ if (argv.h || argv.help || argv['?']) {
3735
process.exit();
3836
}
3937

40-
// Command line handling
38+
process.env.DEBUG = argv.v ? 'ldnode:*' : false;
39+
var debug = require('../logging').server;
40+
var ldnode = require('../index');
41+
4142
// Signal handling
4243
if (process.platform !== 'win32') {
4344
// Signal handlers don't work on Windows.
4445
process.on('SIGINT', function() {
45-
debug("http-server stopped.");
46+
debug("LDP stopped.");
4647
process.exit();
4748
});
4849
}
49-
process.env.DEBUG = argv.v ? '*' : false;
50+
51+
// Starting ldnode
5052
var app = ldnode.createServer(argv);
5153
app.listen(argv.p, function() {
5254
debug('LDP started on port ' + argv.p);
5355
});
56+

0 commit comments

Comments
 (0)