Skip to content

Commit 06a4fbf

Browse files
committed
chore: renamed webapp to frontend for consistency
1 parent ad0ed59 commit 06a4fbf

47 files changed

Lines changed: 13 additions & 15 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/backend/src/index.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,22 @@ app.use(
6565
cors({
6666
origin: true,
6767
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
68-
credentials: true, // allow session cookie from browser to pass through
68+
credentials: true,
6969
}),
7070
);
7171

7272
// Handle static file serving for both development and compiled environments
73-
// const getStaticPath = () => {
74-
// if (process.env.NODE_ENV === 'production') {
75-
// // In production (compiled with Bun), look for static files relative to the executable
76-
// return path.join(process.cwd(), 'frontend/build');
77-
// } else {
78-
// // In development, use the relative path
79-
// const __filename = fileURLToPath(import.meta.url);
80-
// const __dirname = path.dirname(__filename);
81-
// return path.join(__dirname, 'frontend/build');
82-
// }
83-
// };
84-
85-
const staticPath = path.join(process.cwd(), 'frontend/build');
73+
const getStaticPath = () => {
74+
if (process.env.NODE_ENV === 'production') {
75+
// In production (compiled with Bun), look for static files relative to the executable
76+
return path.join(process.cwd(), 'frontend/build');
77+
} else {
78+
// In development, use the relative path
79+
return path.join(__dirname, '../../frontend/dist');
80+
}
81+
};
82+
83+
const staticPath = getStaticPath();
8684
console.log(`Serving static files from: ${staticPath}`);
8785

8886
// Serve static files

0 commit comments

Comments
 (0)