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

const r = Router();

r.post("/start", async (_, res) => {
	const connect = await startTCPServer();
	apiReturn(res, {
		success: connect.success,
		level: connect.success ? "info" : "error",
		module: "routes",
		subModule: "prodSql",
		message: connect.message,
		data: connect.data,
		status: connect.success ? 200 : 400,
	});
});

export default r;
