Comments (5)
"/\d+/posts/" might be a bad example here. Is there a way to provide extra data down into a route? Or maybe we need a way to have routes redirect within the router.
Basically, should it be "/\d+/posts/" or should the user module depend on the blog_posts_resource, which uses the posts uri, and has a "///" route.
from roads.
maybe this isn't best.
Look into building a way to generate child resources? or mixed resources.
so the user resource would depend on a "PostUser" resource, which is an extension of the post resource with brand new routes, each of which expect some form of user information to be provided to the route.
from roads.
Added research tag. This should be decided on after some common use cases have been developed (a more advanced example resource, and some sub_example resources)
from roads.
This uses the technique of stripping out the resource uri on each request.
This is nice because it allows me to move the entire site up into a subdirectory just by changing the example resources uri.
Maybe the right technique is a combination.
Use the uri strip technique, but still provide a way to depend on a core resource, with a separate routing mechanism.
eg.
example depends on user and blog_post
user depends on blog_post(blog_user_routes)
/user/5/posts
becomes user/5/posts after the example uri is removed
becomes 5/posts after the user uri is removed
?becomes 5 after the /posts uri is removed?
?user 5 is loaded, and then we route again into /posts, providing user 5 as a parameter?
The last one seems like the best technique, but I'm not sure how intuitive that would end up. This all seems way too complicated. For the moment maybe we keep this uri stripping thing in as a test, and just assume people use one level of hierarchy. it will be more like the traditional controller scheme that people are used to.
from roads.
Currently, the example uses an empty uri, and then the first level sub routes have /user/, /posts/ etc. This is useful for routing from within a resource.
from roads.
Related Issues (20)
- Extract field expansion and filtering into a separate module HOT 1
- Remove extras HOT 1
- Remove generator dependency HOT 1
- Client side support HOT 3
- Response wrapping should happen before the request handler is called HOT 2
- OPTIONS requests are broken HOT 1
- Support more generic routing options HOT 2
- Support public and private roads HOT 2
- Representation is not used in collection controller of the example
- Build real homepage
- Add max age header so CORS can be cached HOT 1
- types file for roads HOT 18
- The parameters doesn't work HOT 12
- The docs is mixing for cookies HOT 5
- Issue with the response in the version 5.0.0-alpha.14 HOT 20
- cors middleware does not work HOT 1
- Pass data between middleware HOT 1
- Warning node message without use http2 HOT 2
- Parse body issue HOT 1
- Go back and tag releases for old versions
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 roads.