tp6gw94.hashnode.devUse JavaScript running web app in the background有時有需求在背景時仍然要同步資料,當 User 切回頁面時,仍然可以看到最及時的資料。或是發送通知給 User、持續上傳檔案等需求,都需要使用到 javscript 在 Web APP 背景執行的能力。 使瀏覽在背景下繼續執行的方式有許多種,不過以支援度來說最常使用的 Service worker ,並透過 Page Visibility API 確認瀏覽器是否是在背景模式。 Service worker 根據不同的裝置(Mobile, Desktop)與瀏覽器(Chrome, Firefox,...May 21, 2023·6 min read
tp6gw94.hashnode.devAWS SAM create IoTCore custom authorization使用 SAM CLI 建立 nodejs 的 template,並修改 template.yaml 建立一個 lambda function 與 IoTCore 的 Authorizer,並指定 Authorizer 的 function 爲該 lambda function AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: MyIoTCoreAuthorizer: ...Apr 9, 2023·2 min read