我有一个带有 webview 的 Swift 项目,它从本地文件夹 vai GCDwebserver 提供文件,但是该网站被设计为单页应用程序,有什么方法可以将所有 url 请求重写为 index.html?
我目前正在使用 GCDwebserver,但我愿意更改服务器以将 SPA 加载到 webview 中。
使用 nginx 我会做类似的事情
server {
listen 8080;
listen [::] 8080;
root /root/bundled;
location / {
try_files $uri $uri/ /index.html;
}
}
如何在 osx 中的 webview 上获得相同的重写效果?