如何在Caché中设置一个默认的(root, /, index)WEB应用程序?

How to set up a default (root, /, index) WEB application in Caché?

设置了REST应用程序,或者index.html文件在CSP Files目录下显示应用程序,甚至可以将此WEB应用程序设置为服务器的默认应用程序吗?

也就是说,如何通过查询http://localhost而不是http://localhost/AppName/http://localhost/index.html显示应用程序?

拥有 RESTful 应用程序,您需要将您的 WEB 应用程序命名为 '/',并在调度中创建具有相同名称的路由 class:

<Routes>
   <Route Url="/" Method="GET" Call="Index"/>
   ...
</Routes>

...然后根据需要实现 Index 方法。

对于 index.html 文件 - 我相信还有其他人知道解决方案。

您最好的选择是在随实例启动的 Apache 服务器中设置路由规则。

如果想用内部的Apache实现,只需要在Caché中创建root WebApplication即可。以及我确定您之前已经这样做过 /AppName/,只需使用名称 /.

创建

如果你想用外部 Apache 来做,那么我希望你已经 properly 配置了一个。那么你需要的就是添加这样的行

<Location />
  CSP on
  SetHandler csp-handler-sa
</Location>

在您的 REST class 中,您一定已经知道,路由映射使用正则表达式来获取正确的方法。所以,在路线图中你可以改变它

<Routes>
   <Route Url="/(index\.html)?" Method="GET" Call="Index"/>
   <!-- or something like this, to catch all static for one method -->
   <Route Url="/((?!rest/).*)" Method="GET" Call="GetStatic"/>
   ...
</Routes>