Comments (14)
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 public
folder - it supports sub-folders, so /css
should always map to public/css
.
from iodine.
copy / move the other folders into the public folder
Or make a symbolic link to it.
from iodine.
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.
from iodine.
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 open
. On soft links it would open the link file (not the original), on hard links it should open the original.
Much better to copy / move / mount.
from iodine.
It depends on the type of the link (hard vs. soft).
Hard links cannot be to directories on Linux, as far as I know.
Much better to copy / move / mount.
The only possible, if the open used without readlink or a like.
from iodine.
If I want to MOUNT these directories
...Then you link public/great/path/ to ~/blah/
But it is not possible, if only the open system call used on current implementation of Iodine.
from iodine.
@zblsv ,
I will take this into consideration as a feature request for next versions (unless you want to push a PR)... I think using readlink
or realpath
would add an overhead but could add some flexibility to the folder structure. On the other hand, I am not sure how difficult it is to simply copy the files with a script on every deployment.
from iodine.
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.
from iodine.
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.
from iodine.
unless you want to push a PR
I think of adding multiple -route options with two values: "mounted" route and path to the root directory with static files.
from iodine.
This would be a workaround, but imagine the complexity of the setup, adding even a redis in the game.
I'm just going to use a basic nginx for this. Unfortunately it does not handle websocket, but anyway...
from iodine.
it does not handle websocket
You can put nginx as reverse proxy to Iodine. nginx will be serving static files and Iodine will be serving websockets.
from iodine.
Another possible workaround is to use iodine's builtin support for X-Sendfile
and add a middleware that will detect the static file request and return the path with the X-Sendfile
header.
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 (-www ./public
) and the other folders to be mounted using 404
apps within the configuration file (config.ru
).
from iodine.
adding a router to iodine might work?
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.
We could have specific paths routed to specific applications
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.
from iodine.
Related Issues (20)
- Iodine failing to compile with Ruby 3.2.0preview_2 HOT 5
- The future of iodine (vs. plezi)...? HOT 9
- [Rack 3] Response headers with Array value should produce multiple header fields HOT 3
- CPU usage when idle HOT 3
- Iodine.unsubscribe crashes when called with symbol. HOT 4
- Subscribing from the enter_master block subscribes even the children. HOT 3
- unix socket not writeable due umask HOT 8
- Writes to STDOUT even when Iodine.verbosity = 0 HOT 1
- Does not honor HUP signal. HOT 1
- Iodine stops on TERM signal with error when it run with -pid key and more than one worker HOT 1
- The Fixnum is gone as of Ruby-2.4 HOT 3
- response code 418 results in 500 Internal Server Error HOT 1
- [FEAT] return reason for closed connection/client HOT 7
- binary C extension not built? HOT 26
- How to get client instance id HOT 3
- ondisconnect example HOT 1
- rage-rb HOT 1
- undefining the allocator of T_DATA class IodineObjectStorage at startup HOT 2
- Iodine failing to build in fedora 40 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iodine.