Origin http://localhost is not allowed by Access-Control-Allow-Origin.?

前端 未结 3 1613
渐次进展
渐次进展 2020-12-04 18:31

i have a problem... i try to get json api in \"http://api.master18.tiket.com/search/autocomplete/hotel?q=mah&token=90d2fad44172390b11527557e6250e50&secretkey

3条回答
  •  一整个雨季
    2020-12-04 19:07

    I fixed this (for development) with a simple nginx proxy...

    # /etc/nginx/sites-enabled/default
    server {
      listen 80;
      root /path/to/Development/dir;
      index index.html;
    
      # from your example
      location /search {
        proxy_pass http://api.master18.tiket.com;
      }
    }
    

提交回复
热议问题