Skip to content

Commit

Permalink
hardcode base path
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadim Ritter committed Aug 26, 2024
1 parent 85e1561 commit 0ebe809
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineConfig({
// gitTagPlugin()
],

base: "/sps-gui",
base: process.env.VITE_BASE_PATH,

build: {
chunkSizeWarningLimit: 2000
Expand Down
2 changes: 1 addition & 1 deletion server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ app.use(routes);


//static files routes
app.get("/", (req: Request, res: Response) => {
app.get(ENV.BASE_PATH + "/", (req: Request, res: Response) => {
res.sendFile(mainIndexPath);

});
Expand Down
9 changes: 8 additions & 1 deletion server/src/config/envConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ export const PROCTOR_SERVER_PASSWORD = process.env.PROCTOR_SERVER_PASSWORD;

export const SEB_SERVER_INTEGRATED_MODE = process.env.SEB_SERVER_INTEGRATED_MODE;

export const BASE_PATH = process.env.VITE_BASE_PATH;
export const BASE_PATH = getBasePath();

function getServerPort(){
if(!process.env.PROCTOR_SERVER_PORT){
return "";
}
return ":" + process.env.PROCTOR_SERVER_PORT;
};

function getBasePath(){
if(!process.env.VITE_BASE_PATH){
return "";
}
return process.env.VITE_BASE_PATH;
};

0 comments on commit 0ebe809

Please sign in to comment.