Closed app-generator closed 1 year ago
STATUS: ASSIGNED to @umarali
STATUS
In the current version, the URL of the backend and the UI Kit are both hardcoded. The DNDBuilder.setup() helper needs to be updated to allow the injection of the mentioned variable at runtime:
DNDBuilder.setup()
<script type="module"> import { DNDBuilder } from "./index"; DNDBuilder.setup(BACKEND_URL='https://components-server.onrender.com/', UI_KIT='bs5'); // Defaults: // BACKEND_URL=https://components-server.onrender.com/ // UI_KIT=bs5 DNDBuilder.render(); </script>
The above variables are used to query the backend server, currently managed via ENV.
https://github.com/app-generator/free-site-builder/blob/main/src/main.ts
const BACKEND_URL = "https://components-server.onrender.com/"; const url = import.meta.env.VITE_BACKEND_URL ? import.meta.env.VITE_BACKEND_URL : BACKEND_URL; const UI_KIT = "bs5"; const ui_kit = import.meta.env.VITE_UI_KIT ? import.meta.env.VITE_UI_KIT : UI_KIT;
@umarali please take a look.
TY!
I'd be glad to hear some feedback on the commits under branch fix-79 (3c57899). I'm sure there could be a better way.
fix-79
At first look works great. More tests tmrw. TY @umarali
Context
In the current version, the URL of the backend and the UI Kit are both hardcoded. The
DNDBuilder.setup()
helper needs to be updated to allow the injection of the mentioned variable at runtime:The above variables are used to query the backend server, currently managed via ENV.
https://github.com/app-generator/free-site-builder/blob/main/src/main.ts
@umarali please take a look.
TY!