Skip to content

Commit

Permalink
Update server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kangjuhyup authored Oct 7, 2024
1 parent 83f5a56 commit 7232740
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const buildPath = path.join(__dirname, "dist");
app.use(express.static(buildPath));

app.get("*", (req, res) => {
const globalPrefix = '/intro-page';

app.use(globalPrefix, express.static(buildPath));

app.get(`${globalPrefix}/*`, (req, res) => {
res.sendFile(path.join(buildPath, "index.html"));
});

const globalPrefix = '/intro-page';
app.use(globalPrefix);

const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
console.log(`Server is running on port ${PORT}${globalPrefix}`);
});

0 comments on commit 7232740

Please sign in to comment.