This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import nodemailer from 'nodemailer';
|
||||
import cors from 'cors';
|
||||
import dotenv from 'dotenv';
|
||||
@@ -9,9 +8,6 @@ import rateLimit from 'express-rate-limit';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3000;
|
||||
|
||||
@@ -97,12 +93,12 @@ app.get('/health', (req, res) => {
|
||||
});
|
||||
|
||||
// Serve static files from the React app
|
||||
const distPath = path.join(__dirname, 'dist/frontend');
|
||||
const distPath = path.join(process.cwd(), 'dist/frontend');
|
||||
app.use(express.static(distPath));
|
||||
|
||||
// The "catchall" handler: for any request that doesn't
|
||||
// match one above, send back React's index.html file.
|
||||
app.get('*', (req, res) => {
|
||||
app.get('(.*)', (req, res) => {
|
||||
res.sendFile(path.join(distPath, 'index.html'));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user