From 314c5fbfcc1e2da248f3dd2a429b8532e4c8cb76 Mon Sep 17 00:00:00 2001 From: jojobii Date: Sat, 8 Apr 2023 21:47:17 -0700 Subject: [PATCH 1/2] feat(setup): add cors option to setup script --- src/modules/setup.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/setup.js b/src/modules/setup.js index aa64370..1cd82ab 100644 --- a/src/modules/setup.js +++ b/src/modules/setup.js @@ -42,6 +42,12 @@ rl.question(q, r1 => { rl.question(q, r2 => { if (r2) ob['port'] = r2 if (!r1 && r2) ob['selfURL'] = `http://localhost:${r2}/` - final() + + console.log(Bright("\nIf you would like to enable CORS, enter 'y'. (y)\nCORS allows other websites and extensions to use your instance's API.")) + + rl.question(q, r3 => { + if (r3.toLowerCase() !== 'y') ob['cors'] = '0' + final() + }) }); }) From ace49e87dfeed6da27a5f21f401bd1cf3244d596 Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 9 Apr 2023 18:04:03 +0600 Subject: [PATCH 2/2] better wording --- src/modules/setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/setup.js b/src/modules/setup.js index 1cd82ab..1ca41af 100644 --- a/src/modules/setup.js +++ b/src/modules/setup.js @@ -43,7 +43,7 @@ rl.question(q, r1 => { if (r2) ob['port'] = r2 if (!r1 && r2) ob['selfURL'] = `http://localhost:${r2}/` - console.log(Bright("\nIf you would like to enable CORS, enter 'y'. (y)\nCORS allows other websites and extensions to use your instance's API.")) + console.log(Bright("\nWould you like to enable CORS? It allows other websites and extensions to use your instance's API.\n y/n (n)")) rl.question(q, r3 => { if (r3.toLowerCase() !== 'y') ob['cors'] = '0'