I think i'm trying to do something with UIBuilder that it is not meant to do... but i'll see if anybody else has tried something similar.
I have a nodejs app that has 2 express servers running on different ports -- 1 to server the ui pages, and 1 for all the /api/xxxxx
backend ajax calls.
Normally, the project is "built" with webpack, and then both servers are started as stand-alone nodejs commands -- but i'd like to find a way of putting both of them inside a uibuilder
node, called say myapp
.
It has been easy enough to serve the /src and /dist UI files by just putting them under the uibroot directory -- but i'm having trouble finding a way to enable all the api.js logic (the express.use('/api/xxxxx')
endpoints)
I realize that uibuilder is meant to enable the front-end UI to connect with the back-end calls written as node-red flows... so perhaps i'm swimming upstream here, trying to reuse the node-red express server and add my own endpoint urls behind the root url that uibuilder has enabled.
However, if i could do that, then the ui page /myapp/index.html
could make its normal ajax calls to /myapp/api/xxxxx
and run without many modifications... has anybody ever tried to do that? or know of a way to "add on" my api endpoints to uibuilder? Perhaps this is a chance for me to contribute a new feature back to the UIBuilder code... would anybody else find this useful?