Compare commits
4 commits
31301a068b
...
56f1591b6e
Author | SHA1 | Date | |
---|---|---|---|
56f1591b6e | |||
12cceb99cd | |||
c05b6f1a8a | |||
527880457c |
2 changed files with 25 additions and 2 deletions
15
.forgejo/workflows/boot-test.yml
Normal file
15
.forgejo/workflows/boot-test.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
name: "Make sure the server is actually able to start"
|
||||
author: "9pfs@amcforum.wiki (h @ nest)"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
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
|
12
index.js
12
index.js
|
@ -85,6 +85,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