From 10ac1fedeeaa850d7ba57093c6bc817c8c70e35b Mon Sep 17 00:00:00 2001 From: Menci Date: Sun, 9 Dec 2018 23:04:51 +0800 Subject: [PATCH] Fix check if loaded by require() --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index d0f5042..0624e54 100644 --- a/app.js +++ b/app.js @@ -29,7 +29,7 @@ global.syzoj = { app.server = require('http').createServer(app); - if (module.parent) { + if (!module.parent) { // Loaded by `require()`, not node CLI. app.server.listen(parseInt(syzoj.config.port), syzoj.config.hostname, () => { this.log(`SYZOJ is listening on ${syzoj.config.hostname}:${parseInt(syzoj.config.port)}...`);