refactor(app): updated base url to be blank if it was not docker or dev

This commit is contained in:
2026-01-13 17:06:25 -06:00
parent 780335d35c
commit d9d182d908
3 changed files with 155 additions and 442 deletions

View File

@@ -9,13 +9,19 @@ import { lstCors } from "./src/utils/cors.utils.js";
const createApp = async () => {
const log = createLogger({ module: "system", subModule: "main start" });
const app = express();
let baseUrl = "/";
let baseUrl = "";
if (process.env.NODE_ENV?.trim() !== "production") {
app.use(morgan("tiny"));
baseUrl = "/lst";
}
// if we are running un docker lets use this.
if (process.env.RUNNING_IN_DOCKER) {
baseUrl = "/lst";
}
// well leave this active so we can monitor it to validate
app.use(morgan("tiny"));
app.set("trust proxy", true);
app.all(`${baseUrl}api/auth/*splat`, toNodeHandler(auth));
app.use(express.json());