import {OpenAPIHono} from "@hono/zod-openapi";
import {initializeProdPool} from "./prodSqlServer.js";

import closeConnection from "./route/closeProdSql.js";
import connect from "./route/startProdSql.js";
import restart from "./route/restartProdSql.js";

const app = new OpenAPIHono();

setTimeout(async () => {
    initializeProdPool();
}, 2 * 1000);

app.route("/sqlprod/connect", connect);
app.route("/sqlprod/close", closeConnection);
app.route("/sqlprod/restart", restart);

export default app;
