Skip to content

Commit

Permalink
FIXED Few build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rexchoppers committed May 22, 2024
1 parent cc105ea commit 9b68253
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"name": "awms-keycloak-configuration-tool",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "server/index.ts",
"bin": "dist/index.js",
"scripts": {
"start": "node dist/index.js",
"server": "nodemon --watch 'server/**/*.ts' --exec 'ts-node' server/index.ts",
Expand Down Expand Up @@ -32,5 +33,14 @@
"@types/node": "^20.12.12",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"pkg": {
"assets": [
"client/build/**/*",
"server/**/*.ts"
],
"scripts": [
"dist/**/*.js"
]
}
}
8 changes: 5 additions & 3 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ const app = express();
const port = process.env.PORT || 5000;
const router = express.Router();

app.use('/api/keycloak', testRoutes);

const buildPath = path.join(__dirname, '../client/build');
app.use(express.static(buildPath));

app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

app.use(express.static(path.join(__dirname, '../client/build')));
app.use('/api/keycloak', testRoutes);

app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../client/build', 'index.html'));
res.sendFile(path.join(buildPath, 'index.html'));
});

app.listen(port, () => {
Expand Down

0 comments on commit 9b68253

Please sign in to comment.