Skip to content

Commit 3457f7e

Browse files
committed
[O] More stable implmentation
1 parent 0d755ba commit 3457f7e

File tree

6 files changed

+9
-53
lines changed

6 files changed

+9
-53
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,20 @@ jobs:
1818
with:
1919
bun-version: latest
2020

21-
- name: Build frontend for deployment
21+
- name: Build frontend
2222
run: |
2323
cd rooms
2424
bun install
25+
bun run build
26+
cp -r dist ../src/main/resources/
27+
rm -rf dist
2528
VITE_WL_BUILD_PROD=true bun run build
2629
2730
- name: Upload pages build
2831
uses: actions/upload-pages-artifact@v3
2932
with:
3033
path: rooms/dist
3134

32-
- name: Build frontend for embedding
33-
run: |
34-
cd rooms
35-
bun run build
36-
cp dist/combined.html ../src/main/resources/
37-
3835
- name: Setup .NET 8.x
3936
uses: actions/setup-dotnet@v4
4037
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ replay_pid*
2828
._*
2929
build
3030
logs
31-
combined.html
31+
dist

rooms/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "vite build && bun run postbuild.tsx",
8+
"build": "vite build",
99
"preview": "vite preview",
1010
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json"
1111
},

rooms/postbuild.tsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

rooms/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
urls = ['https://use.link.aquadx.net', 'https://usw.link.aquadx.net', 'https://asia.link.aquadx.net', 'https://euro.link.aquadx.net']
1111
names = ["US East", "US West", "Asia", "Europe"]
1212
} else {
13-
urls = ['REPLACE URL HERE qwq']
13+
urls = ['']
1414
names = ['Local Server']
1515
}
1616

src/main/kotlin/FutariLobby.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ val writer: BufferedWriter = FileOutputStream(File("recruit.log"), true).buffere
3737
val mutex = Mutex()
3838

3939
fun Application.configureRouting() = routing {
40-
val html = resStr("/combined.html") ?: "<html><body>Running!</body></html>"
4140
val log = logger()
41+
val hostOverride = System.getenv("HOST_OVERRIDE")
4242

4343
suspend fun log(data: String) = mutex.withLock {
4444
log.info(data)
@@ -50,13 +50,7 @@ fun Application.configureRouting() = routing {
5050
suspend fun log(data: RecruitRecord, msg: String) =
5151
log("${LocalDateTime.now().isoDateTime()}: $msg: ${KJson.encodeToString(data)}")
5252

53-
val hostOverride = System.getenv("HOST_OVERRIDE")
54-
55-
get("/") {
56-
val l = call.request.local
57-
val resp = html.replace("REPLACE URL HERE qwq", (hostOverride ?: "${l.scheme}://${l.serverHost}:${l.serverPort}"))
58-
call.respondText(resp, ContentType.Text.Html)
59-
}
53+
staticResources("/", "dist")
6054

6155
post("/recruit/start") {
6256
val d = call.receive<RecruitRecord>().apply { Time = millis() }

0 commit comments

Comments
 (0)