Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

396
Views
How to deploy ReactJS web application on a windows server using Node.JS?

I have developed a ReactJS app using the create-react-app on my local windows 10 machine..

Now, I want to deploy this application on a on-premise windows 2008 R2 server. I do not have much experience with this. When I searched over the internet, all the articles are talking about either deploying into IIS or in cloud. But, I do not want to use IIS and I have On-Premise server.

Is there any other way to deploy and host this ReactJS application on Windows server machine? Maybe just using the Node.JS?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Create the build using npm run build and write a nodejs script with express to serve the build directory.

The nodejs script would be like this:

start-server.js

const express = require("express");
const path = require("path");

const basePath = '';
const app = express();

app.use(basePath + "/", express.static(path.resolve(__dirname + "/build")));

app.get("*", (request, response) => {
  response.sendFile(path.resolve(__dirname + "/build/index.html"));
});

app.listen(port);

To start the server:

node start-server.js
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!