Giter Site home page Giter Site logo

Comments (7)

weierophinney avatar weierophinney commented on August 23, 2024

The plan is to keep Stratigility purposely bare-bones. The current static routing is really only present to allow segregating different applications; if you want dynamic routing, you would do so in middleware you pipe into the stack. This will also be beneficial in allowing multiple types of routing capabilities, allowing developers to pick the router that works best for their needs.

from zend-stratigility.

mtymek avatar mtymek commented on August 23, 2024

BTW, hypothetical question: what if I wanted to segregate different applications by subdomain, and not path?

from zend-stratigility.

weierophinney avatar weierophinney commented on August 23, 2024

@mtymek — Stratigility's routing is strictly path-based. In the case of segregating applications by subdomain, you'd have to do that in dedicated middleware that's attached without a path.

The approach in this library is exactly the same as with Connect; it's usable on its own, but is really meant as a foundation for a microframework to build on. That's the intent.

from zend-stratigility.

harikt avatar harikt commented on August 23, 2024

Hi @weierophinney ,

What about creating a base interface for router, so that any router that complies with the interface can be plugged in ?

I did played earlier with conduit and from my experiments ( https://github.com/cocoframework/Cocoframework.ApplicationMiddleware ) what I understood is if you are building a middleware with a different router that middleware can itself act as an application .

So I would like stratigility router to be able to handle it. ( As I said like , which is a good thing I believe and which will help not to invent another middleware )

Thank you.

from zend-stratigility.

mindplay-dk avatar mindplay-dk commented on August 23, 2024

@harikt the middleware API already has (or rather, is) a universal interface for routers, dispatchers, anything you can think of. I think there is not much point inventing APIs for specific types of middleware when the middleware API itself can already accommodate just about anything you can dream up - including routers with wildly different semantics and strategies. Integrating my own router was dead easy - and fun :-)

from zend-stratigility.

harikt avatar harikt commented on August 23, 2024

Hey @mindplay-dk ,

I have already played with something similar to your work. See my comments above. What I feel is in that case you don't really need a middleware pipe just to pipe it.

from zend-stratigility.

mindplay-dk avatar mindplay-dk commented on August 23, 2024

@harikt I guess that depends on why you're using a middleware stack in the first place. For me, it's an extra top layer, providing a higher degree of control. And that's pretty much it. To me, it's a utility layer - like, for one, providing more control than, say, .htaccess rewrites, and eliminating most of the dependency on control at the level outside of the programming language.

from zend-stratigility.

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.