I asked in recent times in the NC team and there I was referred to the text app. They implemented it in a PR. No clue how well it works.
How did you try it? Did you use the Vite reverse proxy feature or an external one?
Regarding your question @denisosteo:
Vite makes some assumptions about the project structure. This does not match with the NC structure thus you need some mapping done here.
Explicitly formulated, Vite assumes there are dedicated frontend (HTML/JS/CSS) and backend servers. They might be mapped into one root HTTP server (using a reverse proxy) but are per se separated. Thus Vite server serves all JS/HTML/CSS content in a minimalistic frontend server. You as a dev are responsible to get data aka access to the backend.
With NC, we do not have one monolithic frontend but each app has their own. As a consequence, there are frontend-related URLs in the complete HTTP tree distributed.
The dev using Vite must now decide on how to handle this. Theoretically, there are a few options. Let’s assume, we are talking about an app foo in the custom_apps folder (just to show what kind of URLs are involed):
/apps/foo: the main HTML page is servered
/apps/foo/data: some data is available as REST endpoint
/ocs/v2.php/apps/another-app/bar additional endpoints needed (e.g files) to obtain data
/custom_apps/foo/js JS files of Foo
/custom_apps/foo/css CSS of Foo
By default, the Vite server will serve the current project under /. Thus, the CSS files would be /css.
External proxy
You could forward all requests to /custom_apps/foo/{js,css} to the vite server and the rest to the actual NC server. This is what the text app did.
This means, you have to configure your local dev server/proxy to work with your local dev environment. Especially in a docker environment, this can get a bit hairy as you have to access the host OS from within a container. Also, you can only work on one instance at a time as each vite server runs on a different port. So, you might need to adopt your config regularly.
Configure Vite proxy
Vite knows of the overall problem and allows you to configure an appropriate proxy. You would in the browser then go to the vite URL and Vite would route any unknown endpoint to the backend server (NC).
I would personally prefer this solution as I do not see any big drawbacks but I failed to set it up correctly. Maybe I was too quick to drop it.
Chris