យើង​បាន​ដឹង​រួច​មក​ហើយ​ថា លទ្ធផល​សំរេច​នៃ​កម្មវិធី React អាច​យក​ទៅ​ប្រើ​នៅ​ទីណា​ក៏​បាន​ដែរ មាន​ជា​ឧទាហរណ៍​អាច​យក​ទៅ​ប្រើ​ជាមួយ​នឹង​កម្មវិធី Node.js ក៏​បាន​ដែរ​​ ដោយ​ប្រើប្រាស់​​កញ្ចប់ Express.js ជា​ framework ។

 

const express = require('express');
const path = require('path');
const app = express();

const port = process.env.PORT || '9000';

app.use(express.static(path.join(__dirname, 'build')));

app.get('/', function (req, res) {
  res.sendFile(path.join(__dirname, 'build', 'index.html'));
});

app.listen(port);

 

GitHub: https://github.com/Sokhavuth/react

Heroku: https://khmerweb-react.herokuapp.com/