У меня есть приложение Spring Boot с несколькими API-интерфейсами и стандартное приложение React, созданное с помощью команды create-react-app. Я хочу создать приложение React, используя
npm run build
< br />
и обслуживать созданные файлы из приложения Spring Boot.
Вот структура моего проекта:

Сейчас во время разработки я установил прокси-сервер для frontend/package.json, чтобы отправлять все запросы на внутренний сервер, но в рабочей среде требуется такое же поведение. Как мне этого добиться?
package.json:
Код: Выделить всё
"proxy": "http://localhost:8082/gui",
Код: Выделить всё
org.springframework.boot
spring-boot-maven-plugin
com.github.eirslett
frontend-maven-plugin
1.6
frontend
target
install node and npm
install-node-and-npm
v12.13.1
6.12.1
npm install
npm
install
npm run build
npm
run build
maven-antrun-plugin
generate-resources
run
Код: Выделить всё
server.servlet.context-path=/gui
I need to know how to serve the frontend from my Spring Boot server. Thank you in advance!
Источник: https://stackoverflow.com/questions/619 ... pplication
Мобильная версия