@nodegx/preview 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,9 +81,21 @@
81
81
 
82
82
  <script src="%baseUrl%noodl.deploy.js"></script>
83
83
  <script type="application/javascript">
84
+ // DEP-001: nodegx-config.json beside this page may re-point the backend. The request starts
85
+ // now, not at DOMContentLoaded, so it overlaps the parse. It never rejects: no file (404) or
86
+ // an unreadable one means the address this app was deployed with.
87
+ var noodlDeployConfig = window.Noodl._viewerReact.loadDeployConfig("%baseUrl%nodegx-config.json");
84
88
  document.addEventListener("DOMContentLoaded", function () {
85
89
  const root = document.getElementById("root");
86
- window.Noodl._viewerReact.renderDeployed(root, __noodl_modules, window.projectData);
90
+ const viewer = window.Noodl._viewerReact;
91
+ noodlDeployConfig.then(function (config) {
92
+ try {
93
+ viewer.applyDeployConfig(window.projectData, config);
94
+ } catch (error) {
95
+ console.warn("NodeGX: nodegx-config.json was not applied.", error);
96
+ }
97
+ viewer.renderDeployed(root, __noodl_modules, window.projectData);
98
+ });
87
99
  });
88
100
  </script>
89
101
  </body>
@@ -5,5 +5,6 @@
5
5
  {"url":"load_terminator.js"},
6
6
  {"url":"noodl.deploy.js"},
7
7
  {"url":"react.production.min.js"},
8
- {"url":"react-dom.production.min.js"}
8
+ {"url":"react-dom.production.min.js"},
9
+ {"url":"serve.js"}
9
10
  ]