changes in app.js
This commit is contained in:
+9
-2
@@ -1,6 +1,7 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const multer = require('multer');
|
const multer = require('multer');
|
||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
initializeSalesforceConnection,
|
initializeSalesforceConnection,
|
||||||
@@ -11,9 +12,8 @@ const {
|
|||||||
} = require('./services');
|
} = require('./services');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const frontendDistPath = path.join(__dirname, '../dist');
|
|
||||||
|
|
||||||
app.use(express.static(frontendDistPath));
|
app.use(express.json());
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: 'http://localhost:5173'
|
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 };
|
module.exports = { app };
|
||||||
Reference in New Issue
Block a user