Comments (7)
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.
BTW, hypothetical question: what if I wanted to segregate different applications by subdomain, and not path?
from zend-stratigility.
@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.
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.
@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.
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.
@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)
- Documentation on creating middleware
- MissingResponsePrototypeException thrown when using http-middleware 0.5.0 callable middleware HOT 1
- Zend\Stratigility\MiddlewarePipe missing dependencies HOT 10
- <ignore> HOT 1
- [3.0]MiddlewarePipe marked as `final` HOT 4
- Wrong link in phpdoc HOT 2
- Question about marked a class as final HOT 5
- Documented examples fail HOT 3
- RuntimeException Layer and request path have gone out of sync for capitalised piped route HOT 3
- [RFC] HTTP method overriding middleware HOT 4
- LIFO instead of FIFO HOT 5
- When creating Zend application from scratch HOT 2
- ErrorHandler marked as final HOT 1
- Description of this repository is wrong HOT 2
- Compatibility with zend-httphandlerrunner and zend-diactoros HOT 3
- Middleware Pipe marked as final HOT 2
- Http Response method withStatus not compatible with Psr Interface HOT 3
- New PathMiddlewareDecorator HOT 2
- Add documentation describing using Next handler in middlewares HOT 1
- Naming conflict for "ErrorHandler" which actually is a middleware and not a RequestHandler HOT 3
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 zend-stratigility.