GoogleChromeLabs / web-push-codelab

Other
556 stars 289 forks source link

companion code issue #80

Open vinu123443 opened 6 years ago

vinu123443 commented 6 years ago

hi

i am using this code to make companion on my server using this url https://glitch.com/edit/#!/web-push-codelab?path=static/scripts/send-message.js:1:0

but on this point fetch function i got path error /api/send-push-msg so anybody explain me how i make this url.if anybody know please share companion full code

fetch('/api/send-push-msg', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      subscription: subscriptionObject,
      data: dataString,
      applicationKeys: {
        public: publicElement.textContent,
        private: privateElement.textContent,
      }
    })
  }
gauntface commented 6 years ago

Can you please add what the actual error is that you are seeing.

vinu123443 commented 6 years ago

i am seeing this path issue /api/send-push-msg and if i carete this then what code we mention inside this .

vinu123443 commented 6 years ago

this is my live server where i place the code for companio https://cosmicbuildtech.co.in/code/assets/static/

vinu123443 commented 6 years ago

facing issue with this code when we place files on my server from this url below i send you my zip code .i am facing issue on send-message.js on this point

fetch('/api/send-push-msg', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ subscription: subscriptionObject, data: dataString, applicationKeys: { public: publicElement.textContent, private: privateElement.textContent, } }) } code.zip

vinu123443 commented 6 years ago

what path i mention in place of this /api/send-push-msg

marcoahp commented 5 years ago

I have the same error with /api/send-push-msg