Using create-react-app with React Router + Express.js and Docker. This is a naive and simple way where server-side rendering is not required.
create-react-app
with React Router + Express.js⚠️ This is outdated, please refer to the official and new react-router docs
Clone this repository:
git clone https://github.com/mrpatiwi/routed-react.git
cd routed-react
Install dependencies:
npm install
Start the project at http://localhost:3000
.
npm start
Be sure to install Docker and start a Docker-machine if necessary.
Let's create an image named routed-react
:
docker build -t routed-react .
Finally, start a container named routed-react-instance
at port 80
.
docker run -p 80:9000 --name routed-react-instance routed-react
npm test