In blockchain.coffee under resultTemplate:, change the header key blockchain: to datastore:. At some point we might even rename the entire file and class from "blockchain" to "datasource" since we're already mixing non-blockchain stuff.
I'm concerned it will break because I think I got the regex wrong:
+ (?:\/([^\/\.]+))? # optional property (or action on resource)
The reason I excluded the . was because we didn't want to capture what could be the start of the response format. So a request like the above will currently think that .com is the format. Doh!
I think the regex should be something like this instead:
/// ^
\/(\w+) # the datastore name
\/(\w+) # the corresponding resource
(?:\/([^\/]+))? # optional property (or action on resource)
(?:\/([^\/]+))? # optional action on property
(?:\.(json|xml))? # optional response format
$ ///
Might not be exactly correct... it'll need to tested it thoroughly. It needs to handle both of these requests correctly (they should return the same result):
Pretty much the title, but also:
blockchain.coffee
underresultTemplate:
, change the header keyblockchain:
todatastore:
. At some point we might even rename the entire file and class from "blockchain" to "datasource" since we're already mixing non-blockchain stuff.I'm concerned it will break because I think I got the regex wrong:
The reason I excluded the
.
was because we didn't want to capture what could be the start of the response format. So a request like the above will currently think that.com
is the format. Doh!I think the regex should be something like this instead:
Might not be exactly correct... it'll need to tested it thoroughly. It needs to handle both of these requests correctly (they should return the same result):
If the modified regex above doesn't work, then maybe play with negative lookahead (something like
(?:\/([^\/]+(?!\.json|\.xml)))?
).