react
This commit is contained in:
13
build.gradle
13
build.gradle
@@ -11,7 +11,7 @@ subprojects {
|
|||||||
|
|
||||||
group = 'bit.space'
|
group = 'bit.space'
|
||||||
version = '0.0.1-SNAPSHOT'
|
version = '0.0.1-SNAPSHOT'
|
||||||
sourceCompatibility = '8'
|
sourceCompatibility = '11'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -22,14 +22,25 @@ subprojects {
|
|||||||
extendsFrom annotationProcessor
|
extendsFrom annotationProcessor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
set('springCloudVersion', "2021.0.0")
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-actuator:2.5.5'
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencyManagement {
|
||||||
|
imports {
|
||||||
|
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|||||||
4
server/eureka/build.gradle
Normal file
4
server/eureka/build.gradle
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
|
||||||
|
}
|
||||||
15
server/eureka/src/main/java/bit/space/EurekaApplication.java
Normal file
15
server/eureka/src/main/java/bit/space/EurekaApplication.java
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package bit.space;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableEurekaServer
|
||||||
|
public class EurekaApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(EurekaApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
server/eureka/src/main/resources/application.yml
Normal file
11
server/eureka/src/main/resources/application.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
server:
|
||||||
|
port: 8761
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: eureka-server
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
register-with-eureka: false
|
||||||
|
fetch-registry: false
|
||||||
5
server/gateway/build.gradle
Normal file
5
server/gateway/build.gradle
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
|
||||||
|
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package bit.space;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class GatewayApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(GatewayApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
26
server/gateway/src/main/resources/application.yml
Normal file
26
server/gateway/src/main/resources/application.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
server:
|
||||||
|
port: 10000
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
register-with-eureka: true
|
||||||
|
fetch-registry: true
|
||||||
|
service-url:
|
||||||
|
defalutZone: http://localhost:8761/eureka
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: gateway-server
|
||||||
|
cloud:
|
||||||
|
gateway:
|
||||||
|
routes:
|
||||||
|
- id: member-service
|
||||||
|
uri: lb://MEMBER-SERVICE
|
||||||
|
predicates:
|
||||||
|
- Path=/member-service/**
|
||||||
|
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: health, info, metrics, prometheus, gateway
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
|
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package bit.space;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
|
@EnableDiscoveryClient
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class MemberApplication {
|
public class MemberApplication {
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package bit.space.controller;
|
package bit.space.controller;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequestMapping(path = "/member-service")
|
||||||
public class MemberController {
|
public class MemberController {
|
||||||
|
|
||||||
@GetMapping("/api/welcome")
|
@GetMapping("/api/welcome")
|
||||||
|
|||||||
@@ -1,2 +1,13 @@
|
|||||||
server:
|
server:
|
||||||
port: 9999
|
port: 10001
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: member-service
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
register-with-eureka: true
|
||||||
|
fetch-registry: true
|
||||||
|
service-url:
|
||||||
|
defalutZone: http://localhost:8761/eureka
|
||||||
752
web/front-react/package-lock.json
generated
752
web/front-react/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -6,15 +6,30 @@
|
|||||||
"@testing-library/jest-dom": "^5.16.2",
|
"@testing-library/jest-dom": "^5.16.2",
|
||||||
"@testing-library/react": "^12.1.3",
|
"@testing-library/react": "^12.1.3",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/user-event": "^13.5.0",
|
||||||
|
"axios": "^0.26.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"immutable": "^4.0.0",
|
||||||
|
"open-color": "^1.9.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
|
"react-click-outside": "^3.0.1",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
"react-icons": "^4.3.1",
|
||||||
|
"react-immutable-proptypes": "^2.2.0",
|
||||||
|
"react-redux": "^7.2.6",
|
||||||
|
"react-router-dom": "^6.2.2",
|
||||||
"react-scripts": "5.0.0",
|
"react-scripts": "5.0.0",
|
||||||
|
"react-textarea-autosize": "^8.3.3",
|
||||||
|
"react-transition-group": "^4.4.2",
|
||||||
|
"redux": "^4.1.2",
|
||||||
|
"redux-actions": "^2.6.5",
|
||||||
|
"redux-pender": "^2.0.12",
|
||||||
|
"styled-components": "^5.3.3",
|
||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "cross-env NODE_PATH=src react-scripts start",
|
"start": "cross-env NODE_PATH=src react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test --env=jsdom",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ function App() {
|
|||||||
const [message, setMessage] = useState("");
|
const [message, setMessage] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch('/api/welcome')
|
fetch('/member-service/api/welcome')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(message => {
|
.then(message => {
|
||||||
setMessage(message);
|
setMessage(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user