Skip to content

Commit da9791b

Browse files
committed
Added elements for nodemon quick restarts
Also added returns to try to get out of the nativelands function quickly.
1 parent eec7162 commit da9791b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,8 @@ if (process.env.NODE_ENV === 'development') {
177177
app.listen(3005);
178178
}
179179

180+
if (process.env.NODE_ENV === 'production') {
181+
app.listen(3001);
182+
}
183+
180184
module.exports = app;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"license": "MIT",
1212
"private": true,
1313
"scripts": {
14-
"start": "NODE_ENV=production node ./bin/www",
14+
"start": "NODE_ENV=production nodemon --legacy-watch app.js",
1515
"test": "node ./node_modules/mocha/bin/mocha --config=test/.mocharc.yml --reporter-options reportDir=public,reportFilename=tests",
1616
"build:openapi": "(cd ./openapi && node ./scripts/build-openapi.js)",
1717
"validate:openapi": "yarn build:openapi && bash genoatt.sh && sleep 2 && bash runmochabatch.sh"

v2.0/helpers/landing/landing.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,15 +417,21 @@ const sendNativeLands = async function(req, res, next) {
417417
return;
418418
});
419419

420-
const httpResponse = await (maps.ok);
420+
// Add this check right after the fetch
421+
if (!maps) {
422+
return; // Exit the function if fetch failed
423+
}
424+
425+
const httpResponse = await (maps);
421426

422-
if (!httpResponse) {
427+
if (!httpResponse.ok) {
423428
res.status(500)
424429
.json({
425430
status: 'failure',
426431
data: null,
427432
message: maps.error,
428433
});
434+
return;
429435
} else {
430436
const natland = await maps.json();
431437
res.status(200)

0 commit comments

Comments
 (0)