import { Router } from "express";
import { apiReturn } from "../utils/returnHelper.utils.js";
import { restartTCPServer } from "./tcp.server.js";

const r = Router();

r.post("/restart", async (_, res) => {
	const connect = await restartTCPServer();
	apiReturn(res, {
		success: connect.success,
		level: connect.success ? "info" : "error",
		module: "tcp",
		subModule: "post",
		message: "TCP Server has been restarted",
		data: connect.data,
		status: connect.success ? 200 : 400,
	});
});
export default r;
