sub #215
+7
-5
@@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
import 'localenv';
|
import 'localenv';
|
||||||
import optimist from 'optimist';
|
import optimist from 'optimist';
|
||||||
|
|
||||||
import log from 'book';
|
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
|
|
||||||
import CreateServer from '../server';
|
import CreateServer from '../server';
|
||||||
|
|
||||||
const debug = Debug('localtunnel');
|
const debug = Debug('localtunnel');
|
||||||
@@ -34,6 +31,7 @@ const argv = optimist
|
|||||||
.argv;
|
.argv;
|
||||||
|
|
||||||
if (argv.help) {
|
if (argv.help) {
|
||||||
|
console.log("Showing help");
|
||||||
optimist.showHelp();
|
optimist.showHelp();
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
@@ -49,19 +47,23 @@ server.listen(argv.port, argv.address, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
process.on('SIGINT', () => {
|
process.on('SIGINT', () => {
|
||||||
|
console.error("SIGINT");
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('SIGTERM', () => {
|
process.on('SIGTERM', () => {
|
||||||
|
console.error("SIGTERM");
|
||||||
process.exit();
|
process.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('uncaughtException', (err) => {
|
process.on('uncaughtException', (err) => {
|
||||||
log.error(err);
|
console.error("err:");
|
||||||
|
console.error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('unhandledRejection', (reason, promise) => {
|
process.on('unhandledRejection', (reason, promise) => {
|
||||||
log.error(reason);
|
console.error("reason:");
|
||||||
|
console.error(reason);
|
||||||
});
|
});
|
||||||
|
|
||||||
// vim: ft=javascript
|
// vim: ft=javascript
|
||||||
|
|||||||
Reference in New Issue
Block a user