vincentmorneau / apex-pwa

A complete guide for turning an APEX application into a Progressive Web App
MIT License
82 stars 26 forks source link

Push notification, installing on server (node pushNotification.js) #21

Open guliverNS opened 3 years ago

guliverNS commented 3 years ago

Vincent, I was inspired by your blog post to make my apex app to be PWA. Mostly because of notifications. And I think I've done everything correctly, until the part 7, "Setting up the REST Endpoint". I've followed all your instructions, create pushNotifications.js and change all the things from my Firebase account you mentioned, and create firebase.json by clicking on "generate new private key". Then on my app server, I've execute first command "npm install" and everything was ok. But when I execute "node pushNotification.js" I'm receiving following error: "module.js:478 throw err; ^ Error: Cannot find module 'firebase-admin' at Function.Module._resolveFilename (module.js:476:15) ... ... " My firebase.json doesn't have anything that you have in your package.json file (firebase-admin, express, web-push... and other dependencies). I don't understand how to get that file and how to deploy it. Please help and thanks in advanced!

guliverNS commented 3 years ago

OK I think it's solved now. I had to execute following commands between "npm install" and "node pushNotification.js"

vincentmorneau commented 3 years ago

Happy to hear you solved it! I'll keep that here in case someone needs it in the future.