Ionic-cli: CORS proxy getting No 'Access-Control-Allow-Origin' header is present on the requested resource

Created on 1 Feb 2015  ·  3Comments  ·  Source: ionic-team/ionic-cli

Hello,

Not sure if something changed but...

here is my ionic.project

{
  "name": "wellone",
  "app_id": "",
  "proxies": [
    {
      "path": "/v1",
      "proxyUrl": "https://api.instagram.com/v1"
    }
  ],
  "gulpStartupTasks": [
    "sass",
    "watch"
  ],
  "watchPatterns": [
    "www/**/*",
    "!www/lib/**/*"
  ]
}

and here is how i make the call to instagram api (here i get BAD_REQUEST, but that is fine because next error is the Not allowed origin..)

$http.get('https://api.instagram.com' + '/v1/media/search?client_id=1&lat=48&lng=2.294351').then(function(data) {
          console.log('data ' , data)
        });

Am i missing something?

Most helpful comment

use

$http.get('v1/media/search?client_id...

All 3 comments

use

$http.get('v1/media/search?client_id...

This works!

Thanks a lot..!

Was this page helpful?
0 / 5 - 0 ratings