neibla / cra-dev-examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create-React-App (CRA) Development Examples

This project contains examples for customizing CRA development experience. See package.json for further implementations.

Prereqs:

yarn

Proxying api requests:

Add to package.json to forward unknown requests in development to proxy defined. eg

"proxy": "http://localhost:4000",

More information: https://create-react-app.dev/docs/proxying-api-requests-in-development

https with localhost:

yarn start-https-local

https with custom host over port (local env)

  1. Add custom domain host to /etc/hosts
vi /etc/hosts
127.0.0.1 example.com
  1. generating dev certs with mkcert:
brew install mkcert
mkcert -install
mkcert example.com localhost 127.0.0.1 ::3000
mkdir certs; mv *.pem certs
yarn start-https-custom

HTTPS Proxy

  1. Add custom domain host to /etc/hosts
vi /etc/hosts
127.0.0.1 example.com
  1. generating dev certs with mkcert:
brew install mkcert
mkcert -install
mkcert example.com localhost 127.0.0.1 ::3000
mkdir certs; mv *.pem certs
yarn start-https-custom

or install ssl-proxy via

go get github.com/suyashkumar/ssl-proxy
yarn start-https-custom2

Other local https examples: https://github.com/HugoDF/docker-compose-local-https

other: https://github.com/containous/traefik/

This project was bootstrapped with Create React App.

About


Languages

Language:JavaScript 73.4%Language:HTML 17.3%Language:CSS 9.3%