This commit is contained in:
2022-03-03 18:01:50 +09:00
parent 8ab58f40ff
commit 3e80f1b332
10 changed files with 64 additions and 14 deletions

View File

@@ -24,8 +24,7 @@ subprojects {
} }
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter' compileOnly 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools' developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-test'

View File

@@ -1,6 +1,6 @@
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
} }

View File

@@ -0,0 +1,6 @@
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
}

View File

@@ -0,0 +1,13 @@
package bit.space;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MemberApplication {
public static void main(String[] args) {
SpringApplication.run(MemberApplication.class, args);
}
}

View File

@@ -0,0 +1,14 @@
package bit.space.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class MemberController {
@GetMapping("/api/welcome")
public String welcome() {
return "Welcome To Spring Boot React test";
}
}

View File

@@ -0,0 +1,2 @@
server:
port: 9999

View File

@@ -16,13 +16,11 @@ rootProject.name = 'bit-space'
def gradleFile = new File(subDir.absolutePath, "build.gradle") def gradleFile = new File(subDir.absolutePath, "build.gradle")
if(!gradleFile.exists()){ if(!gradleFile.exists()){
gradleFile.text = gradleFile.text =
""" """
dependencies {
dependencies { }
""".stripIndent(20)
}
""".stripIndent(20)
} }
[ [

View File

@@ -0,0 +1,6 @@
{
"compilerOptions": {
"baseUrl": "./src",
"target": "ES6"
}
}

View File

@@ -12,7 +12,7 @@
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },
"scripts": { "scripts": {
"start": "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",
"eject": "react-scripts eject" "eject": "react-scripts eject"

View File

@@ -1,13 +1,25 @@
import logo from './logo.svg'; import { useEffect, useState } from 'react';
import './App.css'; import './App.css';
import logo from './logo.svg';
function App() { function App() {
const [message, setMessage] = useState("");
useEffect(() => {
fetch('/api/welcome')
.then(response => response.text())
.then(message => {
setMessage(message);
});
},[])
return ( return (
<div className="App"> <div className="App">
<header className="App-header"> <header className="App-header">
<img src={logo} className="App-logo" alt="logo" /> <img src={logo} className="App-logo" alt="logo" />
<p> <p>
Edit <code>src/App.js</code> and save to reload. {message}
</p> </p>
<a <a
className="App-link" className="App-link"