Helenesh
Helenesh

Reputation: 4349

Implement an AngularJS front-end to a Spring back-end

I have a Spring Boot back-end and need to implement an AngularJS(2) front-end to consume my REST API (both running on a single server). I'm a beginner but I haven't found a decent tutorial/demo to help me get started, considering that the following image is my project structure.

enter image description here

Upvotes: 1

Views: 1055

Answers (2)

Ricardo Zorzo
Ricardo Zorzo

Reputation: 299

I'd recommend to have a look at jhipster (https://jhipster.github.io/), it's a yeoman generator that gives you a very nice, clean and tested codebase mixing a spring api and an angular front end. You can set up a project pretty fast and learn a lot from it's structure.

Upvotes: 1

xenteros
xenteros

Reputation: 15842

You should place the front-end in resources/public or resources/static or the third one which I don't remember.

Possible directory structure can be:

enter image description here

in resources/public.

You also should point to that folder in your pom.xml.

<build>
    <resources>
        <resource>
            <directory>${project.basedir}/src/main/resources</directory>
        </resource>
        <resource>
            <directory>${project.build.directory}/generated-resources</directory>
        </resource>
    </resources>
</build>

Upvotes: 0

Related Questions