KIM
KIM

Reputation: 243

ip address 127.0.0.1 cors can't resolve

enter image description here

I have a web service architecture on Google cloud platform

if i entered domain(mydomain.com), it's heading to load balancer and then go to nginx that running on compute engine(virtual machine)

In nginx, proxy indicate 127.0.0.1:3000 and everything works well until now.

127.0.0.1:3000 calling 127.0.0.1:8000 api and cors problem occurs in this moment.

I did apply cors with wild card(*) but cors problem still in progress

enter image description here

enter image description here

how can i fix it?

Upvotes: 0

Views: 301

Answers (1)

Davide Turini
Davide Turini

Reputation: 151

In express you should integrate cors with the specific package. Something like this

var express = require('express')
var cors = require('cors')
var app = express()

app.use(cors())

https://expressjs.com/en/resources/middleware/cors.html

Upvotes: 1

Related Questions