Skip to content

Commit

Permalink
Add log statements for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed Jun 18, 2024
1 parent 0f7b859 commit 21a167d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import console from "console";
import cors from "cors";
import express, { Application, NextFunction, Request, Response } from "express";
import * as fs from "fs";
Expand Down Expand Up @@ -71,13 +72,17 @@ async function handleUncaught(error: Error) {
process.exit(1);
}

console.log("IS_PRODUCTION:", AppSettings.IS_PRODUCTION);
console.log("Run mode:", AppSettings.RUN_MODE);
console.log("DTO:", AppSettings.DTO);
// in production serve the built vue-app from static public folder:
if (AppSettings.IS_PRODUCTION) {
const indexResponse = (req: Request, res: Response) => {
fs.readFile(
path.join(__dirname, "public/index.html"), //
{ encoding: "utf-8" },
(err, data) => {
console.log("Data callback", data);
if (err) {
res.status(404).send(null);
} else {
Expand Down

0 comments on commit 21a167d

Please sign in to comment.