Salam
Salam

Reputation: 89

Frontend angular project not working with Spring boot project after changes to context root

I have a spring boot project that has an angular app integrated into it. The angular is packed into a jar and is made available to the application in the application jar.

The project structure is more or less like this:

enter image description here

It works fine when the context-root is "/". But if I make modifications to the context root from "/" to "/project1" in spring boot configuration file I am no more able to access the frontend.

Could anyone provide any hint how I could fix this problem ?

Upvotes: 0

Views: 843

Answers (3)

JaisAnkit
JaisAnkit

Reputation: 154

You will need to add a base tag to the head of your index.html

<base href="/project1/">

Link to the docs for further explanation if needed: https://angular.io/docs/ts/latest/guide/router.html#!#base-href

Upvotes: 1

RBH
RBH

Reputation: 271

I would assume this is because your client app is packaged as a jar, and will thus not register any changes made to the root context.

Upvotes: 0

Preben Enhed
Preben Enhed

Reputation: 87

Why would you change it? Need for information about this

Upvotes: 0

Related Questions