This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
69 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM ubuntu:latest | ||
|
||
COPY server-0.0.1-SNAPSHOT.jar app.jar | ||
COPY ./build/libs/server-0.0.1-SNAPSHOT.jar app.jar | ||
|
||
ENTRYPOINT ["java","-jar","/app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
import React, { useEffect } from "react"; | ||
import { GlobalStyle } from "@style/globalStyle"; | ||
import React, {useEffect} from "react"; | ||
import {GlobalStyle} from "@style/globalStyle"; | ||
import AppStateProvider from "@provider/theme/AppStateProvider"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import {BrowserRouter} from "react-router-dom"; | ||
import Routes from "@src/routes"; | ||
import axios from "axios"; | ||
|
||
function App() { | ||
useEffect(() => { | ||
axios | ||
.get(`${process.env.SERVER_BASE_URL ?? "http://localhost:8080"}/test`) | ||
.then((res) => { | ||
console.log(res.data); | ||
}); | ||
}, []); | ||
useEffect(() => { | ||
axios | ||
.get(`${process.env.SERVER_BASE_URL ?? "http://localhost:8080"}/test`) | ||
.then((res) => { | ||
console.log(res.data); | ||
}) | ||
.catch(e => console.log(e)); | ||
}, []); | ||
|
||
return ( | ||
<AppStateProvider> | ||
<BrowserRouter> | ||
<GlobalStyle /> | ||
<Routes /> | ||
</BrowserRouter> | ||
</AppStateProvider> | ||
); | ||
return ( | ||
<AppStateProvider> | ||
<BrowserRouter> | ||
<GlobalStyle/> | ||
<Routes/> | ||
</BrowserRouter> | ||
</AppStateProvider> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import * as process from "node:process"; | ||
|
||
const config = { | ||
baseUrl: process.env.REACT_APP_SERVER_URL, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import axios from "axios"; | ||
import config from "@src/config"; | ||
|
||
const usAxios = axios.create({ | ||
baseURL: config.baseUrl, | ||
}) | ||
|
||
class Repository { | ||
async ai1(prompt: string): Promise<Response> { | ||
const {data} = await usAxios.post('ai/1', { | ||
text: prompt | ||
}); | ||
return data; | ||
} | ||
|
||
async ai2(prompt: string): Promise<Response> { | ||
const {data} = await usAxios.post('ai/2', { | ||
text: prompt | ||
}); | ||
return data; | ||
} | ||
|
||
async ai3(prompt: string): Promise<Response> { | ||
const {data} = await usAxios.post('ai/3', { | ||
text: prompt | ||
}); | ||
return data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default interface Response { | ||
state: number; | ||
message: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import {Route, Routes as Switch} from "react-router-dom"; | ||
import {Navigate, Route, Routes as Switch} from "react-router-dom"; | ||
import StartPage from "@src/page/start/StartPage"; | ||
import PlayPage from "@src/page/play/PlayPage"; | ||
|
||
export default function Routes() { | ||
return ( | ||
<Switch> | ||
<Route path={"/"} element={<StartPage/>} /> | ||
<Route path={"/"} index={true} element={<StartPage/>} /> | ||
<Route path={"/play"} element={<PlayPage/>} /> | ||
<Route path={'*'} element={<div>404</div>}/> | ||
<Route path={'*'} element={<Navigate to={'/'} replace={true}/>}/> | ||
</Switch> | ||
); | ||
} |