How to deploy React + Express at same server?

I’m trying to Deploy my React + Express at the same time.
In Dev mode, without Cors, i could develop with below proxy configure

//package.json
//React(3000) => Express(8080)
  "proxy": "http://localhost:8080",

But to deploy production, when i used npm run build and serve -s build, React is working but i can’t get how to use the Express part.

  1. Is npm run build command only for Frontend ?
  2. If so, how do we deploy express part?

That depends on how you having written your Express code. Do you have a link to your backend code (i.e. Glitch)?

1 Like

@RandellDawson

Sadly, I don’t know how to configure my React-Express app on glitch yet…
Instead, i put my github server.js source

I have developed React and Express App on my local macOS and am trying to deploy to Offline(No Internet) Production server.

What is the best way to Deploy to Offiline server?

  1. npm pack with bundledDependencies option in package.json
    Although i pushed all of my packages in bundledDependencies array, when i tried npm install on Production server, it gets error that seems like it still referring some internet connection.

  2. Use Webpack
    I haven’t tried yet… Anybody use this for deploy?

  3. Just copy and paste all of directories including node_modules
    Cuz i could not find any solution yet, i did this and worked, but i feel frustrated… “is it really the only way?”