Compare commits
7 commits
0e440db38c
...
2b0c8208f6
Author | SHA1 | Date | |
---|---|---|---|
2b0c8208f6 | |||
6116df713d | |||
118b3643e7 | |||
56f1591b6e | |||
12cceb99cd | |||
c05b6f1a8a | |||
527880457c |
4 changed files with 33 additions and 4 deletions
17
.forgejo/workflows/boot-test.yml
Normal file
17
.forgejo/workflows/boot-test.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: "Make sure the server is actually able to start"
|
||||
author: "9pfs@amcforum.wiki (h @ nest)"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- id: dependencies
|
||||
run: NODE_ENV=development npm ci
|
||||
- id: boot-test
|
||||
run: TEST_MODE=boot LISTEN_PATH=/tmp/webserver.sock node index.js
|
|
@ -3,7 +3,9 @@ author: "9pfs@amcforum.wiki (h @ nest)"
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "*"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
jobs:
|
||||
node-check:
|
||||
runs-on: docker
|
||||
|
|
|
@ -3,7 +3,9 @@ author: "9pfs@amcforum.wiki (h @ nest)"
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "*"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: docker
|
||||
|
|
12
index.js
12
index.js
|
@ -102,6 +102,14 @@ const listen_path =
|
|||
? "/run/user/2123/countify/webserver.sock"
|
||||
: "/run/user/2123/countify-dev.sock";
|
||||
if (listen_path[0] == "/") {
|
||||
await unlink(listen_path);
|
||||
try {
|
||||
await unlink(listen_path);
|
||||
} catch (e) {}
|
||||
}
|
||||
const listener = app.listen(listen_path);
|
||||
if (process.env?.TEST_MODE == "boot") {
|
||||
console.log("Server started successfully.");
|
||||
// We've successfully started. Time to shut down.
|
||||
listener.close();
|
||||
process.exit(0);
|
||||
}
|
||||
app.listen(listen_path);
|
||||
|
|
Loading…
Reference in a new issue