Skip to content

Starter template for a React project with some different Build Tools

Notifications You must be signed in to change notification settings

bacchilu/react-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 

Repository files navigation

react-template

This is a starting webpack template for a ReactJS project.

Usage

Installing all the dependencies:

npm install

Checking if some updates are available (I use npm-check-updates):

npm run update

Install updates:

npm run install

Build for production:

npm run build

Watch for developement:

npm run watch

Developement web server:

python3 -m http.server
curl http://0.0.0.0:5000/

Usage

npm install
npm run update
npm run build
npm run watch
npm run serve

The developement server runs with "serve".

Proxy dev server

I usually have a Python application server do serve APIs. In this case it is necessary to setup a proxy configuration for Parcel, in order to dispatch some API calls to the developement server.

I define a .proxyrc.json file in this way (documentation):

{
    "/api": {
        "target": "http://dev:8000/",
        "pathRewrite": {
            "^/api": "/api"
        }
    }
}

In the sample above, all API calls starting with /api are redirected to something running on another port (also another domain).

Usage

npm install
npm run update
npm run build
npm run serve

The developement server runs with "serve".

Server Docker

Here I have a simple Python3/Sanic web server.

sudo docker run --rm -it -p 5000:8000 -d bacchilu/sanic-app

curl http://0.0.0.0:5000/json

About

Starter template for a React project with some different Build Tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published