Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Deployment of react static page using node and express

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

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

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

app.listen(9000);
Source by create-react-app.dev #
 
PREVIOUS NEXT
Tagged: #Deployment #react #static #page #node #express
ADD COMMENT
Topic
Name
6+9 =