Entradas

Mostrando entradas de septiembre, 2022

10. React deployment on Nginx (5). Passing client certificate DN to react client

Imagen
 0. Nginx installation #------------------------------------------------------ # INSTALLATION # @see Mohammad Faisal #------------------------------------------------------ #1. Install nginx sudo apt-get update sudo apt-get install nginx #2. verify installation sudo nginx -v #------------------------------------------------------ # STARTUP SETTINGS #------------------------------------------------------ #start Nginx when server restarts sudo systemctl enable nginx #only for checking if nginx is running systemctl status nginx Now, change the local port (for instance to 8081) if you have another server (apache) in port 80 sudo nano /etc/nginx/sites-available/default ( OLD VERSIONS of NGINX !!! ) In newer versions of nginx use this file instead sudo nano /etc/nginx/conf.d/default.conf and edit the port from 80 to 8081 and also change the root from /var/www/html   to another folder like /home/ximo/my-react-app , but to avoid router problems , try

9. React deployment on Nodejs and Express.js and Tomcat(4). tsconfig.json's 'homepage' and BrowserRouter's 'basename'. Errors and peculiarities

0. Preliminars @see create-react-app-dev  and stackoverflow It is assumed that we are using CLIENT-SIDE ROUTING! 0.1 Typescript source project  The source project is in the " my-react-app " folder. It was created by typing npx create-react-app my-react-app --template typescript and then adding extra libraries as react-router-dom etc.   0.2 Executing the project The source project has been executed by 3 diferent ways 0.2.1 In development mode By typing  npm start 0.2.2 Running the production build with 'serve' First, build the project, then install 'serve' if it is not installed and finally run the build #Build the project npm run build #Install globally the "serve" javascript web server IF NOT INSTALLED !!! sudo npm install -g serve #Run the application from the build folder serve -s buid 0.2.3 Running the production build with 'express' or nodej Once you have build the project in the "build" folder. Create a