Create a very lightweight PWA (Progressive Web App) that is aim to pass the 100% score in Google Lighthouse.
Follow the instructions bellow, and enjoy.
Clone the repo, and run it manually with the following command line:
- Go to the root directory of the project:
cd verylite-pwa
- Install the Node dependencies with
npm install
- Finally, run
npm run server-debug
and launch with your favorite browser this URL: https://localhost - If it's working, you can use the command
npm run server
to run the server without debugging. - If not, you can try to open Google Chrome on Mac without the
https
restrictions:
open 'Applications/Google Chrome.app' --args --user-data-dir=/tmp/foo --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://localhost
If you need to generate the certs for your localhost, you can use:
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
Other options are available:
- Follow the procedures of this Gist by @cecilemuller.
- You can use plugins to generate your key/certificate pair, like Swissknife for VSCode. Open the command pallette and click "Self signed certificate."
• To test using Chrome with invalid certs use the following to open the browser:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/foo --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://localhost
- Clone the repository and make a new pull request
- Create a new pull request on github and follow the pull request guidelines
- Add new feature and contact me to add it to the project :)
- PWA-101: help/base boilerplate for this repo, thanks.