refactor(app): updated base url to be blank if it was not docker or dev
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user