commit | efd93a7f01f3c7e40b6d736bd47d9d7c06d40903 | [log] [tgz] |
---|---|---|
author | 马金凯 <majk@vip.qq.com> | Fri Oct 26 21:32:35 2018 +0800 |
committer | min <z82507200@gmail.com> | Fri Oct 26 21:32:35 2018 +0800 |
tree | 301159acf36d231f10b34c041890020aed6b36b4 | |
parent | 3991c421fbb86ae6b6d71111b8a38732e775245f [diff] |
Change to frontend proxy (#167) * Remove backend CORS * Add frontend proxy * Add axios to global
application.properties
The generic configuration, shared byapplication-develop.properties
andapplication-production.properties
application-production.properties
(default)
The configuration for productionapplication-develop.properties
The configuration for develop
Clone source code on develop branch
Specify registry address in dubbo-admin-backend/src/resources/application-production.properties
Build
mvn clean package -Pproduction
will active production configuration(application-production.properties
)mvn clean package -Ddevelop
will active develop configuration(application-develop.properties
)
Start mvn --projects dubbo-admin-backend spring-boot:run
Visit http://localhost:8080
Configuration in IDE
Select configuration files in Intellij Idea
Choose profile file during project importing
develop
maven profile: Choose profile file in the Maven Projects tool window to activate profiles.
develop
maven profile.Select configuration files in Eclipse
dubbo-admin-backend
develop
maven profile Run backend project
backend is a standard spring boot project, you can run it in any java IDE
Run frontend project
run with npm run dev
visit webpage visit http://localhost:8081
, frontend supports hot reload.
CORS problem for convenien of development, we deploy frontend and backend separately, so the frontend supports hot reload. In this mode, frontend will request localhost:8080
to fetch data, this will cause a CORS problem, so we add a configuration in I18nConfig.java
to support CORS, this configuration will only be active under develop mode, please select the right maven profile to support this.
Once deployed, you can check http://localhost:8080/swagger-ui.html to check all restful api and models
Apache Dubbo ops is under the Apache 2.0 license, Version 2.0. See LICENSE for full license text.