M
M
Marat Ivanov2019-08-08 11:21:33
Node.js
Marat Ivanov, 2019-08-08 11:21:33

How to solve cors issue using node api?

Tell me how to solve the issue with a cross-domain request through Api node.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Kostyaev, 2019-08-08
@mrair

Set server CORS permission to localhost:3000, no?
and so on node.js on express I did this:

const cors = require("cors");
  
  app.use(
    cors({
      origin: 'http://localhost:3000',
      credentials: true
    })
  );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question