Skip to content

Commit

Permalink
fix: resolve Writesonic#4 build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
unownone committed Dec 14, 2023
1 parent 79217d1 commit fa6df55
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 187 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"scripts": {
"build": "tsc -p tsconfig.json",
"start": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts"
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"start": "nodemon dist/index.js"
}
}
}
38 changes: 18 additions & 20 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,24 @@ import buildServer from "./server";
* @returns {Promise<void>} A promise that resolves when the server is successfully started
*/
async function main() {
const server = await buildServer();
try {
await server.listen({
port: 8000,
host: "0.0.0.0",
});

["SIGINT", "SIGTERM"].forEach((signal) => {
process.on(signal, async () => {
server.log.info("Shutting down server...");
await server.close();
process.exit(0);
});
});

} catch (err) {
server.log.error(err);
process.exit(1);
}
const server = await buildServer();
try {
await server.listen({
port: 8000,
host: "0.0.0.0",
});

["SIGINT", "SIGTERM"].forEach((signal) => {
process.on(signal, async () => {
server.log.info("Shutting down server...");
await server.close();
process.exit(0);
});
});
} catch (err) {
server.log.error(err as object);
process.exit(1);
}
}

main();
main();
Loading

0 comments on commit fa6df55

Please sign in to comment.