我有一个使用Spring Boot应用程序作为REST客户端的Angular2应用。
以前,我是分别启动两个应用程序的 - Spring Boot通过启动SpringBootApplication主方法(它开始监听8080端口),Angular2 - 从命令行运行npm start
(通常在3000端口上启动)。
现在我想要Maven用一个命令来运行这两个应用程序。
- Angular 4.0.0
- Spring Boot 1.5.4.RELEASE
我一直在尝试应用答案和这个教程。但是在第一种情况下只启动了Angular应用程序,在第二种情况下只启动了REST应用程序。
我的package.json:
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"serve": "lite-server -c=bs-config.json",
"prestart": "npm run build",
"start": "concurrently \"npm run build:watch\" \"npm run serve --proxy-config proxy-config.json\" ",
"lint": "tslint ./src/**/*.ts -t verbose"
},
"license": "ISC",
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/common": "~4.0.0",
"@angular/compiler": "~4.0.0",
"@angular/core": "~4.0.0",
"@angular/forms": "~4.0.0",
"@angular/http": "~4.0.0",
"@angular/material": "^2.0.0-beta.7",
"@angular/platform-browser": "~4.0.0",
"@angular/platform-browser-dynamic": "~4.0.0",
"@angular/router": "~4.0.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.26",
"angular-in-memory-web-api": "~0.3.0",
"angular2-modal": "^3.0.1",
"bootstrap": "^3.3.6",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"jsplumb": "^2.4.3",
"ng2-bs3-modal": "^0.10.4",
"ng2-popup": "^0.4.0",
"rxjs": "5.0.1",
"systemjs": "0.19.40",
"zone.js": "^0.8.4"
},
"devDependencies": {
"concurrently": "^3.2.0",
"lite-server": "^2.2.2",
"typescript": "~2.1.0",
"canonical-path": "0.0.2",
"tslint": "^3.15.1",
"rimraf": "^2.5.4",
"@types/node": "^6.0.46"
},
"repository": {}