好的,现在我已经在我的 Couchapp 根文件夹中添加了一个 rewrites.js 文件。在这个 js 文件中,我有...
[
{
"method": "GET",
"from": "/home",
"to": "app/index.html",
}
]
现在,当我推送 Couchapp 时,在我的 _design/rednecks 中的 CouchDB 中,我看到它正在使用上述 js 创建一个“重写”属性。所以这对我来说一切都很好。这是怎么做的对吗?
我将 local.ini 虚拟主机更改为...
[vhosts]
rnr.couchdb:5984 = /rednecks/_design/rednecks
在 Chrome 中我输入网址...
我得到同样的错误......
{"error":"not_found","reason":"Document is missing attachment"}
app/index.html 附件绝对存在。我能看到它。如果我禁用重写并使用丑陋的网址,该应用程序运行良好。我已经尝试了我能想到的“to”字符串的所有变体,我看到的只是上面的相同错误。
有谁知道如何做到这一点?!?!?!....
跟进...
好的,遵循 Marek 的建议并将我的 rewrites.json 文件设置为此...
[
{ "from": "home", "to": "app/index.html" },
{ "from": "lib/*", "to": "app/lib/*" },
{ "from": "js/*", "to": "app/js/*" },
{ "from": "css/*", "to": "app/css/*" },
{ "from": "img/*", "to": "app/img/*" }
]
快到了。感谢您的帮助,它现在开始融合在一起:-)