【问题标题】:wt: Document root was not set, or was set to the empty path.wt:未设置文档根目录,或设置为空路径。
【发布时间】:2017-09-20 13:11:35
【问题描述】:

我是 wt(Web Toolkit/witty) 的新手。当我尝试执行 hello-world 示例程序 source code 时,出现以下异常“Document root was not set, or was set to empty path. Use --docroot to set the HTML root directory.”我将命令参数设置为“--http-address=0.0.0.0 --http-port=8080 --deploy-path=/hello --docroot=.”。我将参数值捕获为“Arg C = 1 and Arg V = 0000023C3B649E30”请帮忙。

【问题讨论】:

  • 欢迎来到 StackOverflow。目前尚不清楚您在问什么。请澄清您的问题。
  • 您不能将.(点)用作文档根。创建一个新目录并将其与--docroot 选项一起使用。
  • 您的 argc 与您确实在指定参数相矛盾。 Argc=1 表示程序在没有参数的情况下启动。你把论据放在正确的地方了吗?

标签: c++ visual-c++ visual-studio-2012 wt


【解决方案1】:

我不确定您是否找到了解决方案。只是为了帮助别人。 如果您想从 linux 中的 cli/terminal 运行您的 wt Web 应用程序,这里是您需要提供的选项列表。

./<your_web_app> --http-address=0.0.0.0 --http-port=8085 --deploy-path=/hello --docroot=.

现在转到您的浏览器并打开新标签并输入“http://localhost:8085/hello

应该给你你正在构建的网页

【讨论】:

    【解决方案2】:

    以下解决方案对我有用。

    “如果您使用的是 Visual Studio,则可以通过右键单击项目来添加它们,然后转到属性 > 配置属性 > 调试 > 命令参数。

    打开网络浏览器并转到http://localhost:8080/hello 以测试您的应用程序。”

    https://andres.jaimes.net/780/how-to-create-a-first-application-using-wt-witty/

    【讨论】:

      猜你喜欢
      • 2023-03-05
      • 1970-01-01
      • 2021-12-19
      • 2022-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-12
      • 2021-10-07
      相关资源
      最近更新 更多