PWA using webhooks

I created a PWA using only n8n webhooks.

It works like this: A webhook serves as the entry point and outputs text. A switch node detects if the webhook has a “file” argument set to either “sw” or “manifest.” If it does, it serves the Service Worker or the Manifest (two key components of a PWA). If there are no arguments or if the argument is invalid, it returns the HTML.

check it out: https://vps.filipeteixeira.com.br/webhook/meu-pwa

notice that to change the route you’ll have to change in several places as it is hard coded into the webhook, html and manifest. If you use n8n free like me, it’s easier to search and replace directly the json using a text editor. For n8n paid version you can maybe use a environment variable for this.