react-native-workers icon indicating copy to clipboard operation
react-native-workers copied to clipboard

API call not working inside worker js file

Open jitenderchand1 opened this issue 8 years ago • 1 comments

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

jitenderchand1 avatar Sep 28 '16 11:09 jitenderchand1

@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?

drudge avatar Oct 25 '16 13:10 drudge