0

Having the REST application set up, or having the index.html file displaying application under CSP Files directory, is it even possible to set this WEB application as a default one for the server?

In other words, how to display the application by querying http://localhost, but not http://localhost/AppName/ or http://localhost/index.html?

4

3 回答 3

1

Having the RESTful application, you need to name your WEB-application as '/', and create the route with the same name inside the dispatch class:

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

...and then implement the Index method as you desire.

In case of the index.html file - I believe that there is someone other who know the solution.

于 2016-02-04T21:59:28.067 回答
1

Your best bet is likely to setup routing rules in the Apache server that is started with the instance.

于 2016-02-05T00:10:17.110 回答
1

If you want to achieve it with internal Apache, you just only need to create root WebApplication in Caché. As well as I'm sure you already did it before like /AppName/, just create with name /.

If you want to do it with external Apache, then I hope you already have properly configured one. Just what you need then, is to add such lines

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

In you REST class, you must be already know, that Route map uses regexp to get correct method. So, in routes map you can change it so

<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>
于 2016-02-05T08:40:28.067 回答