-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static file serving: allow mounting of multiple local dirs #147
Comments
Hi @bmedici , At the moment the public folder is singular. In the future I want to introduce an iodine router that will allow multiple apps and public folders, but... At the moment the only workaround is to copy / move the other folders into the |
Or make a symbolic link to it. |
This has nothing to do with the original feauree described. If I want to MOUNT these directories it's, exactly to avoid moving or linking them. |
I'm not sure if a symbolic link will be resolved properly. It depends on the type of the link (hard vs. soft)... I just use the system call Much better to copy / move / mount. |
Hard links cannot be to directories on Linux, as far as I know.
The only possible, if the open used without readlink or a like. |
...Then you link public/great/path/ to ~/blah/ |
@zblsv , I will take this into consideration as a feature request for next versions (unless you want to push a PR)... I think using |
Still not, as linking in another directory s not the same as mounting. Just a basic example for you to understand the difference : linking in the first directory would be a modification. It may be unwanted. Or impossible. |
Bruno, It needs a more concrete example. It is difficult to understand what exactly is required. If you stuck on the using the -www option and nothing else, then run separate Iodine process on each of the directories and connect the Iodines to eachother by the Redis. |
I think of adding multiple -route options with two values: "mounted" route and path to the root directory with static files. |
This would be a workaround, but imagine the complexity of the setup, adding even a redis in the game. |
You can put nginx as reverse proxy to Iodine. nginx will be serving static files and Iodine will be serving websockets. |
Another possible workaround is to use iodine's builtin support for Iodine really has enough features that extending it should be easy (even if this can't be always done from the CLI). As for a future feature: I assume that adding a router to iodine might work? We could have specific paths routed to specific applications (each with their own public folder)...? This will allow the main app to use the CLI ( |
It might work, for instance, if we want have a route of "GET /main.js" leading to ./public/javascripts/site.js And we are lazy to make the hard link. Or if we already have the ./public/main.js served somehow by another legacy app.
I am rather skeptical about this. In real life we use something like Apache APISIX for maintaining webapps. And we isolating its from each other as much as possible. Webapps are buggy as hell. |
Hi,
From my understanding, it's easy to serve static files (with great handling for gz content), with the --public flag, or public: "local_dir".
For my use case, I'd like to be able to mount subdirs, living outside the public dir. Example: shared file between projects, proejct-specific overrides, etc.
Any way to implement this easily with Iodine ?
Thank you !
The text was updated successfully, but these errors were encountered: