Spread the love

Create a package.json file containing following contents.

    "name": "app_name",
    "version": "1.0.0",
    "description": "",
    "main": "app.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    "author": "",
    "license": "ISC",
    "dependencies": {
        "express": "^4.16.3",
        "path": "^0.12.7",
        "react-color": "^2.18.1"
npm install

Now Create app.js file containing following contents.

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'));


Install pm2 for forever running node app.

npm i pm2 -g

Upload build (npm run build) folder along with app.js

Start Server

pm2 start app.js

now app is running on specified port in app.js

Last modified: April 13, 2022



Write a Reply or Comment

Your email address will not be published.