feat(sql): full sql start stop and query with crash prevention
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
import express from "express";
|
||||
import morgan from "morgan";
|
||||
import { createLogger } from "./src/logger/logger.controller.js";
|
||||
import { connectProdSql } from "./src/prodSql/sqlConnection.controller.js";
|
||||
import { setupRoutes } from "./src/routeHandler.route.js";
|
||||
|
||||
const port = Number(process.env.PORT);
|
||||
export const baseUrl = "";
|
||||
|
||||
const startApp = async () => {
|
||||
const log = createLogger({ module: "system", subModule: "main start" });
|
||||
const app = express();
|
||||
let baseUrl = "/";
|
||||
|
||||
// global env that run only in dev
|
||||
if (process.env.NODE_ENV?.trim() !== "production") {
|
||||
app.use(morgan("tiny"));
|
||||
baseUrl = "/lst";
|
||||
}
|
||||
|
||||
// start the connection to the prod sql server
|
||||
connectProdSql();
|
||||
|
||||
Reference in New Issue
Block a user