A production grade progressive web app, to hit the ground running.
$ npm install
NODE_ENV (build-dependent)
PWA_ENV (build-dependent)
PWA_PUBLIC_PATH (build-dependent)
PWA_SSR (build-independent)
PORT (build-independent)
build-dependent: if any of these variables values have to be changed, assuming you change PWA_PUBLIC_PATH=//other.cdn.com
in the staging:build
script, then it requires a rebuild and a restart, npm run staging
build-independent: if any of these variable values have to be changed, assuming you change PWA_SSR=false
in the staging:start
script, then it only requires a restart, npm run staging:start
There are some useful npm scripts setup for you to start using these ENV variables effectively, please look at package.json to better understand how they're setup for each script.
Remember to run
npm stop
to stop all the pwa pm2 instances before using a different script from below.
Start as local development server with file watching:
$ npm start
# runs at http://localhost:8000
# npm run stop is automatically called for you after
# hitting ctrl+c to quit the webpack-dev-server
Start as local production server:
$ npm run development
# runs at http://localhost:1337
Start as staging server:
$ npm run staging
# runs at http://localhost:1337
Start as production server:
$ npm run production
# runs at http://localhost:1337
Using pm2:
$ npm run pm2 -- logs # follow all server logs
$ npm run pm2 -- list # list all processes
$ npm run pm2 -- kill # kill pm2 parent process
$ npm run pm2 -- help # show other available commands