prerender.io 和 asp.net 核心验证失败

prerender.io and asp.net core verification failed

我使用 aurelia(单页应用程序)创建了一个网站。由于 SEO 元标记是在客户端运行时添加的,因此搜索引擎无法获取这些标记。 我发现 prerender.io 作为这个问题的解决方案,但是我无法用它来验证我的应用程序。

我的后端实现了 asp.net 核心,并且 运行 作为应用服务。 我使用了这个中间件:https://github.com/dingyuliang/prerender-dotnet/wiki/Prerender-Middleware-for-ASP.NET-Core

我的配置是:

{
  "PrerenderConfiguration": {
    "ServiceUrl": "http://service.prerender.io",
    "Token": null,
    "CrawlerUserAgentPattern": null,
    "WhiteListPattern": null,
    "BlackListPattern": "lib|css|js",
    "AdditionalExtensionPattern": null,
    "ProxyUrl": null,
    "ProxyPort": 80
  }
}

我也试过把Configuration中的“Token”设置成我在左上角登录后在网站上看到的那个。 我是否遗漏了任何步骤,或者 github 页面上的说明是否不完整?

似乎这个 github 仓库不再维护了。像 https://github.com/dingyuliang/prerender-dotnet/pull/6/commits/77a8cdd8931ee5bf1955f39d03b9ba2150ee5e2c 这样的拉取请求已经好几年没有通过了。我不确定发生了什么,但 nuget 包中的 dll 不工作(可能是旧版本?)。 但是,代码本身正在运行。我最终复制了我需要的所有文件(Constants.cs、PrerenderConfiguration.cs、PrerenderMiddleware.cs、PrerenderMiddlewareExtendsions.cs 和 WebProxy.cs)合并了一些新建议并将其添加为我的解决方案。现在可以使用了。