summaryrefslogtreecommitdiff
path: root/src/ircd.mjs
blob: 192435071a87fe6c8df9391ea80ce51507ca72c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 path => {
	if (fs.existsSync(path)) {
		fs.unlinkSync(path);
	}
	server.listen(path, () => {
		hero.log.info({ type: "starting-server", path });
	});
};