Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

API call not working inside worker js file #15

Open
jitenderchand1 opened this issue Sep 28, 2016 · 1 comment
Open

API call not working inside worker js file #15

jitenderchand1 opened this issue Sep 28, 2016 · 1 comment

Comments

@jitenderchand1
Copy link

var obj = {method:'POST'}
fetch('http://localhost:3000/',obj).then(function(){
self.postMessage("check");
})

@drudge
Copy link

drudge commented Oct 25, 2016

@jitenderchand1 Hard to help with no detail, but here are some things to check:

  • Are you sure you mean localhost? This would mean that you want to access port 3000 on the device
  • If this is android and you are running your http server on your machine, have you used adb reverse tcp:3000 tcp:3000 to make it available on the device?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants