Giter VIP home page Giter VIP logo

Comments (6)

canove avatar canove commented on August 24, 2024

Bom dia, @developerdevice.

Geralmente esses erros ocorrem quando a configuração do ".env" não está correta no backend. Posta o exato erro que aparece no navegador e também seu arquivo .env do backend pra gente tentar entender melhor.

Abraço

from whaticket-community.

developerdevice avatar developerdevice commented on August 24, 2024

Esse é o meu arquivo .env

NODE_ENV=DEVELOPMENT
BACKEND_URL=https://api.meusite.com.br
FRONTEND_URL=https://app.meusite.com.br
PROXY_PORT=443
PORT=8080

DB_HOST=localhost
DB_DIALECT=
DB_USER=whaticket
DB_PASS=whaticket
DB_NAME=whaticket

JWT_SECRET=3123123213123
JWT_REFRESH_SECRET=75756756756

Abaixo o erro no browser

Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em https://api.meusite.com.br/whatsapp/. (Motivo: esperado 'true' no cabeçalho CORS 'Access-Control-Allow-Credentials').

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.meusite.com.br/whatsapp/. (Reason: CORS request did not succeed).

Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em https://api.meusite.com.br/users/2. (Motivo: esperado 'true' no cabeçalho CORS 'Access-Control-Allow-Credentials').

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.meusite.com.br/users/2. (Reason: CORS request did not succeed).

Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em https://api.meusite.com.br/tickets?withUnreadMessages=true. (Motivo: esperado 'true' no cabeçalho CORS 'Access-Control-Allow-Credentials').

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.meusite.com.br/tickets?withUnreadMessages=true. (Reason: CORS request did not succeed).

Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em https://api.meusite.com.br/tickets?pageNumber=1&status=open&showAll=false. (Motivo: esperado 'true' no cabeçalho CORS 'Access-Control-Allow-Credentials').

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.meusite.com.br/tickets?pageNumber=1&status=open&showAll=false. (Reason: CORS request did not succeed).

Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em https://api.meusite.com.br/tickets?pageNumber=1&status=pending&showAll=true. (Motivo: esperado 'true' no cabeçalho CORS 'Access-Control-Allow-Credentials').

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.meusite.com.br/tickets?pageNumber=1&status=pending&showAll=true. (Reason: CORS request did not succeed).

from whaticket-community.

canove avatar canove commented on August 24, 2024

Acredito que o nginx pode estar conflitando com a política de CORS do express. O seu arquivo de configuração do nginx está exatamente igual ao do tutorial?

from whaticket-community.

developerdevice avatar developerdevice commented on August 24, 2024

esse é o backend, eu revisei todo o readme, refiz todos os passos, mas estagnou nesse passo.

Screenshot_1

from whaticket-community.

canove avatar canove commented on August 24, 2024

Parece estar tudo ok. Em qual cloud provider vc está rodando a aplicação? As políticas de CORS são definidas no arquivo app.ts do backend:
image

Se você não alterou esse arquivo, tudo deveria funcionar corretamente...

from whaticket-community.

developerdevice avatar developerdevice commented on August 24, 2024

Apaguei a pasta backend e subi a do github, só assim parou os erros, obrigado pela força.

from whaticket-community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.