Hi there, I'm trying out OX.
A bit of context: until now I've used Dancer. I want to try OX and see how I like it. I have read the whole OX advent calendar 2012 and understood most of it (I'm not very familiar with Bread::Board yet).
I have a RESTful API, and I'm trying to do something a bit similar to Dancer::Plugin::REST: send something different to clients depending on the format requested. More specifically I want to send JSON back on /api/action.json, YAML on /api/action.yaml, or a prettified JSON in a HTML template on /api/action.
So far my idea is to match all those with a single route. In Dancer I would do:
/api/action.:format
And then my View object would render something that depends on the request's path: that's dead simple with OX.
My problem is that the /api/action.:format route doesn't seem to match anything. Indeed, I don't see anything similar in the Path::Router documentation, which OX is based on. Does it mean it's impossible to do what I want with OX? OX seems powerful, so I guess not.
What could be a solution to my problem?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |