After this reading on the dark side your app will be.

It sounds like repetitions on the header but no. Although this is a react tutorial, the core functionality won’t actually be react specific. This means you can use the logic on Angular, Vue.js and simple HTML/CSS/JS app.

Ideally you should follow up with react, but if you are smart enough you can code directly in your Angular or Vue.js app.

Code

The full code of this story is available on this git repository, you can pull it directly and continue as only important parts of the code will be explained.

Get Started


Most of us surely know where to place the following snippet and how it works. If you don’t then you found this article at the right time 😏.

server {
listen 80;
listen [::]:80;

root /var/www/example/html;
index index.html;

server_name example.com www.example.com;
location /api/ {
proxy_pass http://127.0.0.1:4000/;
}
location / {
try_files $uri $uri/ =404;
}

}

If you guessed it is a nginx config code then you are really concerned but worry no more because after reading this article you won’t need that anymore (for react/node apps).

Deploying node/react on a single domain is a great challenge and many solutions…

Momo Tidjani

JavaScript developer, MERN lover.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store