Skip to main content

Posts

Showing posts from September, 2020

Typescript Express Project base

Create repo on github with gitignore set to node $ mkdir <path/foldername> && cd <path/foldername> $ git init $ git remote add origin https://github.com/biboyatienza/typescript-expressjs.git $ git pull origin master $ echo "# typescript-expressjs" >> README.md $ npm init $ git add . $ git commit -m "first commit" $ git push -u origin master $ npm i -D typescript tslint $ npm i express -S $ npm i @types/express -D $ code tsconfig.json {     "compilerOptions": {       "module": "commonjs",       "esModuleInterop": true,       "target": "es6",       "moduleResolution": "node",       "sourceMap": true,       "outDir": "dist"     },     "lib": ["es2015"]   } $ code tslint.json {     "defaultSeverity": "error",     "extends": [         "tslint:recommended"     ],     "jsRule

PWA - Service Worker

// https://github.com/185driver/pwa-app-updates /* eslint-disable no-undef, no-underscore-dangle, no-restricted-globals */ // This is the code piece that GenerateSW mode can't provide for us. // This code listens for the user's confirmation to update the app. self . addEventListener ( "message" , ( e ) => { if (! e . data ) { return ; } switch ( e . data ) { case "skipWaiting" : self . skipWaiting (); break ; default : // NOOP break ; } }); workbox . core . clientsClaim (); // Vue CLI 4 and Workbox v4, else // workbox.clientsClaim(); // Vue CLI 3 and Workbox v3. // The precaching code provided by Workbox. self . __precacheManifest = []. concat ( self . __precacheManifest || []); // workbox.precaching.suppressWarnings(); // Only used with Vue CLI 3 and Workbox v3. workbox . precaching . precacheAndRoute ( self . __precacheManifest , {}); // END OF => https://github.com/185driver/pwa-app-updates workbox .