changes in app.js
This commit is contained in:
+9
-2
@@ -1,6 +1,7 @@
|
||||
const express = require('express');
|
||||
const multer = require('multer');
|
||||
const cors = require('cors');
|
||||
const path = require('path');
|
||||
|
||||
const {
|
||||
initializeSalesforceConnection,
|
||||
@@ -11,9 +12,8 @@ const {
|
||||
} = require('./services');
|
||||
|
||||
const app = express();
|
||||
const frontendDistPath = path.join(__dirname, '../dist');
|
||||
|
||||
app.use(express.static(frontendDistPath));
|
||||
app.use(express.json());
|
||||
app.use(cors({
|
||||
origin: 'http://localhost:5173'
|
||||
}));
|
||||
@@ -70,4 +70,11 @@ app.post('/api/documents', upload.array('documents'), async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
const frontendDistPath = path.join(__dirname, '../dist');
|
||||
|
||||
app.use(express.static(frontendDistPath));
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(frontendDistPath, 'index.html'));
|
||||
});
|
||||
|
||||
module.exports = { app };
|
||||
Reference in New Issue
Block a user