webcane / spring-boot-angular2-static-sample

Demos using Spring boot with Angular2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot with Angular2

This is a recipe for using Spring Boot with Angular 2 as described here

Steps to recreate the project

spring init --dependencies=web spring-boot-angular2-static-sample
cd spring-boot-angular2-static-sample
ng init

Edit angular-cli.json and modify outDir to src/main/resources/static/

That is it, build angular 2 content:

ng build

Start up UI:

mvn spring-boot:run

Additional Steps

Proxy the backend by creating a proxy.conf.json file with entries:

{
  "/api": {
    "target": "http://localhost:8080",
    "secure": false
  }
}

and start up UI part of the app using:

ng serve --proxy-config proxy.conf.json

About

Demos using Spring boot with Angular2


Languages

Language:JavaScript 99.2%Language:Shell 0.3%Language:TypeScript 0.2%Language:Batchfile 0.2%Language:Java 0.0%Language:HTML 0.0%Language:CSS 0.0%