Ability to declare HTTP resources #3
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 17 hours
Due date
c.fahner
17 hours
No due date set.
Blocks
#1 Request/response flow
slendium/framework
Reference
slendium/framework#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Modules should be able to declare HTTP resources. Each resource can respond differently based on the HTTP method. Supported query or body arguments are declared as function parameters and filled in using reflection.
Resources exposed by modules exist in a fixed namespace called
Resourcesrelative to theModuleimplementation to avoid having to keep track of all possible routes in a big centralized map. The filesystem itself basically becomes the routing table. Every incoming request is mapped to a resource based on implementation-defined (or even user-defined) routing rules. A basic implementation could simply map the URLs' path to a class name.Links to other HTTP resources on the system can be declared in a type-safe manner by referencing the
class-string<Resource>. This has the additional benefit of auto-detecting broken internal links through static analysis of the code and makes switching between front-end (HTML-generating) code and back-end code as easy as just following the class reference.