Skip to content

Commit

Permalink
fix build issues of express-server
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkohli96 committed Oct 6, 2024
1 parent 84cb25d commit 206d818
Show file tree
Hide file tree
Showing 3 changed files with 752 additions and 775 deletions.
10 changes: 7 additions & 3 deletions apps/express-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@
* However when generating the build and running it,
* tsc-alias will replace the alias imports with the
* actual import path relative to each file.
*
* Sadly "node -r tsconfig-paths/register dist/index.js" is
* not resolving the paths when running the build.
*
* "node -r ts-node/register/transpile-only -r tsconfig-paths/register dist/main.js"
* works but not recommended to be used in production because
* of the lack of type safety.
*/

import 'dotenv/config';
import os from 'os';
import { replaceTscAliasPaths } from 'tsc-alias';
import { createServer } from 'node:http';
import { ENV_VARS } from '@/app-constants';
import { winstonLogger } from '@/middleware';
import app from './app';

const hostName = os.hostname();
const port = ENV_VARS.port;
console.log('port 22: ', port);

function bootstrap() {
/* DB Connection Logic */
Expand All @@ -39,5 +44,4 @@ function bootstrap() {
});
}

replaceTscAliasPaths();
bootstrap();
3 changes: 1 addition & 2 deletions apps/react-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"react-router-dom": "^6.24.1",
"react-router-dom": "^6.26.2",
"react-scripts": "5.0.1",
"redux-persist": "^6.0.0",
"web-vitals": "^3.5.2"
Expand All @@ -36,7 +36,6 @@
"@types/node": "^20.14.9",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-router-dom": "^5.3.3",
"@types/react-redux": "^7.1.33",
"eslint": "^8.57.0",
"typescript": "^5.3.3"
Expand Down
Loading

0 comments on commit 206d818

Please sign in to comment.