This app does two things:
- helps me track my time how I’d like to (stopwatch vs pomodoros, etc)
- let’s me play with Progressive Web Apps (PWAs)
App is hosted on Github Pages. Go to it here!
https://kvimber.github.io/officers-log/
- need to be in the project directory
- List Github Pages Build (Github API Docs)
- Get latest Pages build (Github API Docs)
- note this is using the Github CLI
- all you really need to do is serve the files locally
- I tend to do this with python
- python3 version is above
- for python2, I think the command is this:
python -m HTTP.Server
- but I’m not sure, so you might have to look it up if it doesn’t work (/ check CLI history)
- turns out a lot of the pages were getting 404 results
- found running Lighthouse tools PWA Audits
- wasn’t sure about the issue, but I could see a number of the resources were trying to be loaded from the domain root
- ie: kvimber.github.io/manifest.json
- rather than at the project subdomain: officers-log/manifest.json
- so I tried removing the root slashes from the beginning of the URLs in the code
- did this in commit 661cbb90
- forgot one more in the manifest: fixed in commit 9bcf72d1
- worked!
- this was pretty simple, but there was a timing hiccup that I didn’t understand at first
- just set the publishing source from the repo settings
- in my case: just setting the repo to publish from the
main
branch at the root folder - Configuring a publishing source for your GitHub Pages site (Github Docs)
- in my case: just setting the repo to publish from the
- the hiccup was that the project needs a Github Pages build to run after you configure this
- so there’s a bit of a delay until the site really shows up
- which I later found I could figure out using the Github CLI
- specifically the API subcommand
- look to the “Find Github Pages Build” command above for how to do this
- site created from A Simple Progressive Web App Tutorial (Medium)
- written by James Johnson
- code saved on github: jamesjohnson280/hello-pwa
- done as commit 948171f0