GithubHelp home page GithubHelp logo

Comments (14)

boazsegev avatar boazsegev commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

copy / move the other folders into the public folder

Or make a symbolic link to it.

from iodine.

bmedici avatar bmedici commented on June 8, 2024

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.

boazsegev avatar boazsegev commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

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.

boazsegev avatar boazsegev commented on June 8, 2024

@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.

bmedici avatar bmedici commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

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.

bmedici avatar bmedici commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

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.

boazsegev avatar boazsegev commented on June 8, 2024

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.

zblsv avatar zblsv commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.