Skip to content

Commit b0bf9f1

Browse files
committed
bootstrap app even if json file has not been found
1 parent 3025d53 commit b0bf9f1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package/node_modules
22
test-app/node_modules
33
npm-debug.log
4+
test-app/www

package/src/ConfigurationProvider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ export function loadConfigurationJSON(callback) {
3636
xobj.overrideMimeType("application/json");
3737
xobj.open('GET', 'configuration.json', true); // Replace 'my_data' with the path to your file
3838
xobj.onreadystatechange = function () {
39-
if (xobj.readyState == 4 && xobj.status == 200) {
40-
// Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
41-
(<any>window).configuration = JSON.parse(xobj.responseText);
39+
if (xobj.readyState == 4) {
40+
if (xobj.status == 200) {
41+
(<any>window).configuration = JSON.parse(xobj.responseText);
42+
}
4243
callback();
4344
}
4445
};

test-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"webpack:watch": "webpack --config webpack.fastcss.config.js --watch --env development",
1111
"fastcss": "gulp watch",
1212
"serve": "webpack --config webpack.development.config.js --watch --env development",
13+
"serve2": "webpack --config webpack.development.config.js --watch",
1314
"serve:production": "webpack --config webpack.production.config.js --watch --env production"
1415
},
1516
"author": "Geek Learning",

0 commit comments

Comments
 (0)