From e10a581fd84fbac186a6179eefe3c0db76b8a84a Mon Sep 17 00:00:00 2001 From: ITwoo <49831379+ITwoo@users.noreply.github.com> Date: Thu, 3 Feb 2022 15:02:03 +0900 Subject: [PATCH] deprecate module.parent repalce (require.main === module) --- 404/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/404/app.js b/404/app.js index 87e7d87..78723ac 100644 --- a/404/app.js +++ b/404/app.js @@ -23,4 +23,4 @@ app.use(async function pageNotFound(ctx) { } }); -if (!module.parent) app.listen(3000); +if (require.main === module) app.listen(3000);