So, for example, let's say I have an API in webapp, and I want to use the same controllers and actions in the API as other web applications.
In my urlmappings file I have
"/api/$version/$apiKey/$controller/$acion/$id?"
and I also have a mapping like this:
"/blog/$year/$month/$day/$action" {
controller = 'blog'
}
Now the question is, can I somehow prefix the api urlmapping in the urlmapping of the blog so that I can use the variables $ year, $ month, $ day? so that a GET request is given to the following URL:
GET /api/0.1/bs23mk4m2n4k/blog/2001/01/05/list
or am I forced to make the following request instead?
GET /api/0.1/bs23mk4m2n4k/blog/list?year=2004&month=01&day=05
Need help from urlmappings GURU or groovy manlupings runtime runtime WIZARD :)
I want a solution that can reuse existing URLs other than api, instead of redrawing them using the api path as a prefix.