# Is it safe to use the uibuilder route for a Node-RED based http-in API?

**URL:** <https://discourse.nodered.org/t/is-it-safe-to-use-the-uibuilder-route-for-a-node-red-based-http-in-api/55767>\
**Category:** General\
**Tags:** uibuilder\
**Created:** [27 December 2021 20:25 UTC](https://discourse.nodered.org/t/is-it-safe-to-use-the-uibuilder-route-for-a-node-red-based-http-in-api/55767 "2021-12-27T20:25:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [27 December 2021 21:15 UTC](https://discourse.nodered.org/t/is-it-safe-to-use-the-uibuilder-route-for-a-node-red-based-http-in-api/55767/2 "2021-12-27T21:15:00Z")

</div>

Julian (@TotallyInformation) and I had a [similar discussion](https://discourse.nodered.org/t/can-i-host-stand-alone-nodejs-apps-inside-uibuilder-nodes-if-so-should-i/51813) just a few months ago, as I was looking for a simple way to serve my stand-alone nodejs application's UI and API endpoints from node-red. It was dead simple to set up a new `ui_builder` root node (i.e. as `/myapp`), check out the myapp repo into the uibuilder directory, and serve all the front-end pages as '/myapp/ui/index.js'.

The tricky part for my use case was that I already had dozens of back-end rest apis defined as express routes on a separate port in 'api.js'. Julian showed me how to add those to an express router function, which could be added to ui\_builder, and effectively served as '/myapp/api/xxx' endpoints -- just what I needed! And I suspect would work for your situation as well. By the way, I would suggest that you **do not use the same root url** for both front-end UI and back-end API calls.

The unfortunate thing is that all of this work was done in the vnext branch, which is not due for public release any time soon. Perhaps when he gets back from holiday, we can help him debug an alpha version of code...

---

_[View the full topic](https://discourse.nodered.org/t/is-it-safe-to-use-the-uibuilder-route-for-a-node-red-based-http-in-api/55767)._
