Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

when sending an error, return instead of executing the rest of the code #44

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ app.get("/micro-frontends-config", async function (req, res) {
mfeRoutes = await fsPromises.readFile(path.join(configPath + env_config.mfeConfigPath))
break;
default :
res.send({'error': { message: "Check application environment", code: 500 }})
break;
return res.send({'error': { message: "Check application environment", code: 500 }})
}
res.send(mfeRoutes);
});
Expand All @@ -52,8 +51,7 @@ app.get("*", async function (req, res) {
mfeIndex = mfeIndex.data
break;
default :
res.send({'error': { message: "Check application environment", code: 500 }})
break;
return res.send({'error': { message: "Check application environment", code: 500 }})
}
let mfeRoutes
switch (process.env.APPENV.toLowerCase()) {
Expand All @@ -67,8 +65,7 @@ app.get("*", async function (req, res) {
mfeRoutes = await fsPromises.readFile(path.join(configPath + env_config.mfeRoutesPath))
break;
default :
res.send({'error': { message: "Check application environment", code: 500 }})
break;
return res.send({'error': { message: "Check application environment", code: 500 }})
}
let mfeIndexHtml = htmlParse.parse(mfeIndex)
let singleSpaMain = mfeIndexHtml.querySelector('#single-spa-main')
Expand Down