AFAIK 재 작성은 현재 URL 경로에 일치하는 변수에 접미사를 추가 할 수 없습니다.
당신이 사용할 수있는 또 다른 접근법은 주어진 키 ("content"또는 유사) 아래에 id가 "file"인 문서에 file.html의 내용을 넣고 show function [1]을 콘텐츠 형식이 "text/html로"와 해당 키의 값을 출력하는) "렌더링"다음 라이터를 만들 같은 같은 :
{
"from": "/:doc",
"to": "/_show/render/:doc",
"method": "GET",
"query": {
}
}
전체 설계 문서는 다음과 같이 보일 것이다 :
{
"_id": "_design/rewrite",
"shows": {
"render": "function(doc) { return { headers: { \"Content-Type\": \"text/html\"}, body: doc.content } }"
},
"rewrites": [
{
"query": {},
"method": "GET",
"to": "/_show/render/:doc",
"from": "/:doc"
}
]
}
그리고 해당 문서 :
,
{
"_id": "file",
"content": "<html>html content of doc goes here</html>"
}
위의 패턴 [2]을 따르는 예가 나와 있습니다.
[1] http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
[2] https://mikewallace.cloudant.com/rewriter/_design/rewrite/_rewrite/file
완벽한 - 감사합니다! –