南希的主机目录

Host sudirectory with Nancy

您好,我正在尝试使用 Nancy selfhosting 来托管一个简单的 HTML 网站。

我还需要一些 js 文件,它们存储在子目录“scripts”中。

这是我的子目录的 Bootstrapper 函数:

protected override void ConfigureConventions(Nancy.Conventions.NancyConventions nancyConventions)
{
    nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("scripts", "scripts"));
    base.ConfigureConventions(nancyConventions);
}

现在,如果我在版本 1.0.0 中安装 Nancy。然后启动程序并打开浏览器,我无法加载任何js文件。

对于所有 js 文件,我收到一个错误:ERR_CONNECTION_RESET

Nancy 的 0.23.2 版本与相同的代码、相同的 html 和相同的 js 文件完美配合。

这是错误还是 1.0.0.

版本中有不同的配置

听起来您 运行 关注这个已知问题:https://github.com/NancyFx/Nancy/issues/1789