Queens-Hacks / qcumber-api

transforms qcumber data repo into something blah
1 stars 3 forks source link

Skeleton routed #5

Closed Graham42 closed 10 years ago

Graham42 commented 10 years ago

Not sure if I'm heading in the right direction with this

uniphil commented 10 years ago

Awesome! Looks pretty nice.

This might be a complete dead-end, or redundant with your additions, but when I was looking through the werkzeug docs, the dispatcher middleware caught my eye. So an option would be to make a base class for each resource, which is a full legit wsgi app, and route to them with the dispatcher. Maybe that's a bit heavy duty for simple routing, I don't know. Routing the resources with your ResourceRouter would certainly be sufficient.

I like WSGI. I like layers. Later if, say, we want to add cacheing... just drop in a middleware at whichever layer we'd like to do caching. Authentication? no prob bob.

Graham42 commented 10 years ago

I definitely like the idea of having each resource as an object. I'm still wrapping my head around the implementation might work, but I definitely like it.