Skip to content

ghas-results/dynamicpay-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DynamicPay Demo Site

This is a demo site.

Installation

Use a package manager like npm or yarn to install dependencies and start the development server

# for npm users
npm install && npm start
# for yarn users
yarn && yarn start

Usage

This project was created with Create-React-App (CRA), by default CRA use Workbox to create the service worker, and use features as Strategies, Precaching, Runtime caching, and so on. You can find it in src/swWorkbox.js.

Currently, the project is using a custom Service Worker, built with Vanilla JS, which you can modify to implement your own cache strategies. You can find it in public/swCustom.js.

Service workers can run only over HTTPS connection, to see more you can visit this link.

To use Workbox or a custom service worker, just replace the file name in src/swRegister.js

swRegister.js

window.addEventListener('load', () => {
    const swUrl = `${process.env.PUBLIC_URL}/swCustom.js`;

Custom Service Worker

To test with ngrok your custom service worker offline, you'll need:

  1. Download and install ngrok
  2. Serve the project
    # for npm users
    npm start
    # for yarn users
    yarn start
  3. Once your local server is up, e.g. http://localhost:3000 you can deploy it over a HTTPS connection with ngrok
    {path-of-ngrok-executable}/ngrok http 3000
  4. Finally, you can test your page offline and see what resources are being cached with browser DevTools

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8