Nodejs applications & dynamic paths

Hello :slight_smile:

we are currently evaluating whether Open OnDemand is the right platform for us to use for our custom applications.
This custom application part is also my main responsibility, the integration of Open OnDemand on our cluster is handled by others. I am rather new to Open OnDemand, so please forgive me if this is a rather trivial question or completely off.

We want to enable users to “easily” write (nodejs) applications that run on our cluster via Open OnDemand.
To make the app development as easy as possible we want to support high-level frameworks like Next.js and not only low-level libraries like express.js. Our users should not be required to program code for handling http-requests and other low-level tasks that are already solved in many frameworks, but rather focus on their application.

Now many of these modern high-level web application frameworks have a build step, and the URL where the application will be accessible has to be provided during the build step and cannot be changed dynamically once the application is launched. See for example here for Next.js

This has been a problem for a few considered solutions other than Open OnDemand, where the URL was only set after a user launched the application, which would mean, that we can only build the app after the user pressed the “start”-button.
This introduces a long undesirable delay between launching the application and being able to use it.

So my question is: is it possible to use frameworks that need a static URL at build time in Open OnDemand? Maybe using a reverse proxy?
Are there any example applications in nodejs (or other languages) using high-level frameworks that I can have a look at and use as a template?

Thank you & all the best
Alexander

OnDemand is itself a reverse proxy. The shell application is a node.js application using express. You can use that as an example.

Though note that you have to mount the application to this environment variable that is the path prefix for the URL.

We use Phusion Passenger to boot the applications. You can find more here: Understanding Passenger - Passenger + Node.js basics - Passenger Library

Hope that helps. Just ask more questions if you have them.

Also - hi and welcome!

Thank you so much for your helpful answer Jeff!

Our plan is to have a simple way for researchers deploy gui applications on our cluster, and since writing GUIs and managing routing functionality is not the main focus of most researchers, we wanted to use a higher-level framework than express.js, e.g. next.js.

I will update this thread once we figure out how to remove the few remaining minor bugs here.