React projenizde npm run build komutu ile yapılandırma dosyalarınızı oluşturun. Zaten bunu yapmışsınız.
dist veya build klasörü içindeki dosyalarınızı ExpressJS ile yayına alabilirsiniz;
https://dev.to/juhanakristian/basics...-expressjs-phd
Örnek bir app.js dosyası;
const express = require('express');
const path = require('path');
const app = express();
app.use(express.static(path.join(__dirname, 'dist')));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'dist ', 'index.html'));
});
app.listen(3000, () => {
console.log('Server çalıştırıldı. Port: 3000');
});