React Tips
Integrating dev server in Visual Studio
Extract the IIS Express certificate from the machine store under Personal certificates, to a pfx including the private key (set a password)
choco install openssl
openssl pkcs12 -in devserver.pfx -nocerts -out devserver.key
openssl pkcs12 -in devserver.pfx -clcerts -nokeys -out devserver.crt
openssl rsa -in devserver.key -out devserver-decrypted.key
- Add package reference to Microsoft.AspNetCore.SpaServices.Extensions
- Create a .env file in the root of the app folder:
BROWSER=none
SSL_CRT_FILE=devserver.crt
SSL_KEY_FILE=devserver-decrypted.key
- In Startup.cs, add the line
spa.UseProxyToSpaDevelopmentServer("https://localhost:3000");
(replacing existing linespa.UseReactDevelopmentServer(npmScript: "start");
) - In terminal launch the dev server with
npm run start