diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | src/ircd.mjs | 14 |
2 files changed, 10 insertions, 5 deletions
@@ -136,7 +136,6 @@ uninstall: run-ircd: all - rm -f ircd.sock ./src/bin.mjs ircd ircd.sock run-web: all diff --git a/src/ircd.mjs b/src/ircd.mjs index af4d280..1924350 100644 --- a/src/ircd.mjs +++ b/src/ircd.mjs @@ -1,13 +1,19 @@ +import fs from "node:fs"; import net from "node:net"; +import * as hero from "./hero.mjs"; + + const server = net.createServer(socket => { socket.write("olar\r\n"); socket.pipe(socket); }); -export const app = async udsPath => { - await db.init(); - server.listen(udsPath, () => { - console.log("I'm ircd."); +export const app = async path => { + if (fs.existsSync(path)) { + fs.unlinkSync(path); + } + server.listen(path, () => { + hero.log.info({ type: "starting-server", path }); }); }; |