fix(start): change the way the app is launched

* And updated README accordingly
This commit is contained in:
Florent Chehab
2020-04-20 11:03:07 +02:00
parent 033d01e1cf
commit 0ef46fea2f
4 changed files with 17 additions and 13 deletions

View File

@@ -9,8 +9,13 @@ const SERVER_MODES = {
const args = getArgs();
if ( typeof args.mode === "undefined" || (args.mode !== "production" && args.mode !== "development")) {
throw new Error("--mode=development or --mode=production is expected")
if ( typeof args.mode === "undefined") {
// default to production mode
args.mode = "production";
}
if (args.mode !== "production" && args.mode !== "development") {
throw new Error("--mode can only be 'development' or 'production'")
}
const server_mode = args.mode === "production" ? SERVER_MODES.PRODUCTION : SERVER_MODES.DEVELOPMENT;