afx*_*afx 12 javascript uritemplate node.js express
我正在使用节点和表达.要注册控制器我打电话:
app.get('/user/:id', function (req, res) {...});
Run Code Online (Sandbox Code Playgroud)
但我想用rfc-6570方式做到这一点:
app.get('/user/{id}', function (req, res) {...});
Run Code Online (Sandbox Code Playgroud)
我在谷歌代码上搜索了python中的一个实现,但没有找到任何内容(除了谷歌代码上的死链接到http://www.snellspace.com/wp/?p=831).
一般来说,URI模板并不像第一眼看上去那么容易.看看RFC中的示例.
PS:我也需要客户端上的URI模板.
我一直在清理http://code.google.com/p/uri-templates/wiki/Implementations上的实施列表- 在https://github.com/marc-portier/uri-上有一个JS 模板,但我不确定它是否实现RFC,也不确定它的质量.
请注意,我们已经开始在这里发布测试:https: //github.com/uri-templates/uritemplate-test
所以,如果你想检查它,你可以从那里开始.