0

I am running two application in one Angular project, what I want is to run the apps in a Tomcat server. My problem is when I try to build it and put the dist folder in the Tomcat, it is not recognizing the cpho.html and hhpnz.html as an index.html file even though I try to set it up as an index.html in the .angular-cli.json, any solution? work around? or maybe even a better way to do this?

Here is my project structure

Here is my .angular-cli.json, cpho, and for hhpnz

  • would it be possible for you to split up your project? and use the common things as dependency? see https://stackoverflow.com/questions/47152331/how-to-setup-angular-project-as-a-dependency-in-package-json-of-another-angular – Axel M Oct 01 '18 at 21:05

1 Answers1

0

I may not really understand your question,

but speaking of Tomcat, index.html has special treatment as a "welcome file" (the file that is returned when a client makes request for a directory containing this file).

The list of welcome file names is configurable in Web application descriptor file (WEB-INF/web.xml). The details are in the Servlet specification.

The default configuration is the following:

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
Konstantin Kolinko
  • 3,854
  • 1
  • 13
  • 21
  • What i did is add my 2 index.html file (cpho.html & hhpnz.html) in the welcome-file-list, but I'm wondering if it's the right way to do it? Now i;m starting to think maybe do what @Axel M says like try to split the project up and use the common things as dependency. – Roman Socorro Oct 01 '18 at 21:29
  • If it is your own `WEB-INF/web.xml` it is OK to configure it how it best suits your web application. (A common mistake is to start modifying the files in Tomcat's conf/ directory. Those are the defaults shared by all applications). From a philosophical point of view, I think I would prefer to rename the files to 'index.html'. – Konstantin Kolinko Oct 01 '18 at 21:56
  • BTW, [Cool URIs don't change](https://www.w3.org/Provider/Style/URI) - an article on design of URLs. – Konstantin Kolinko Oct 01 '18 at 21:59
  • but the problem I'm having if I put it back in the index.html name is that there will be 2 of them (cpho.html and hhpnz.html) in the src folder. – Roman Socorro Oct 01 '18 at 22:39