Demo available : https://confused-stitch.glitch.me/
POST https://confused-stitch.glitch.me/api/login
POST (protected ) https://confused-stitch.glitch.me/api/ ( with correct headers )
var request = require("request");| const glob = require("glob") | |
| const util = require('util'); | |
| const exec = util.promisify(require('child_process').exec); | |
| // Updte with your image path | |
| const yourImagesPath = "/home/mobileui/app/wp-content/uploads/2018/01/*.jpg"; | |
| glob(yourImagesPath, {}, function (er, files) { | |
| if( er ) throw new Error( er ); |
| caches.open('my-pwa-demo') | |
| var CACHE_NAME = "my-pwa-demo"; | |
| var CACHED_URLS = [ | |
| '/', | |
| "index.html", | |
| "app.js", | |
| "app.css" |
| /* | |
| | -------------------------------------------------------------------------- | |
| | Prerender the checkout page from the cart | |
| | -------------------------------------------------------------------------- | |
| | | |
| +*/ | |
| add_action( 'wp_head', function(){ | |
| global $woocommerce; |
| /* | |
| | -------------------------------------------------------------------------- | |
| | Defering prompt | |
| | -------------------------------------------------------------------------- | |
| */ | |
| let deferredPrompt; | |
| window.addEventListener('beforeinstallprompt', event =>{ |
Demo available : https://confused-stitch.glitch.me/
POST https://confused-stitch.glitch.me/api/login
POST (protected ) https://confused-stitch.glitch.me/api/ ( with correct headers )
var request = require("request");| function onPageRequest(req, res) { | |
| res.writeHead(200, { | |
| 'Content-Type': 'application/json', | |
| "Access-Control-Allow-Origin": "*" | |
| }); | |
| res.end(JSON.stringify( | |
| { |
| [...document.querySelectorAll('input')].forEach( input => { | |
| input.setAttribute('value', `my type is ${input.getAttribute('type')}`); | |
| input.setAttribute('style', `color:black; font-size:20px; font-weight:bold;`); | |
| }); |
node ttfb.js https://www.google.com/ 20Will create 20 curl test for https://www.google.com/
| /** | |
| * cacheOrNetwork | |
| * | |
| * Look for and returns an event request in the cache | |
| * @param {eventRequest} event | |
| * @param {string} cacheName | |
| */ | |
| const cacheOrNetwork = async (event, cacheName) => { | |