Não manda as informações pro mysql.Já tentei algumas coisas, instalei o sequelize que também não funcionou. Baixei o projeto do módulo 2, então acredito que o problema não esteja no código.
Quando rodo isso no terminal:
curl http://localhost:3000/pagamentos/pagamento -X POST -v -H "Content-type: application/json" -d @files/pagamento.json | json_pp
Parece isso:
Note: Unnecessary use of -X or --request, POST is already inferred. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 127.0.0.1:3000...
- TCP_NODELAY set
- Connected to localhost (127.0.0.1) port 3000 (#0)
POST /pagamentos/pagamento HTTP/1.1 Host: localhost:3000 User-Agent: curl/7.68.0 Accept: / Content-type: application/json Content-Length: 112
- upload completely sent off: 112 out of 112 bytes
- Mark bundle as not supporting multiuse < HTTP/1.1 500 Internal Server Error < X-Powered-By: Express < Content-Type: application/json; charset=utf-8 < Content-Length: 82 < ETag: W/"52-GvhK/m1A49HFZFiwEyhw1w" < Date: Mon, 17 Aug 2020 22:08:58 GMT < Connection: keep-alive < { [82 bytes data] 100 194 100 82 100 112 10250 14000 --:--:-- --:--:-- --:--:-- 24250
- Connection #0 to host localhost left intact { "code" : "ER_NOT_SUPPORTED_AUTH_MODE", "errno" : 1251, "fatal" : true, "sqlState" : "08004" }
E isso aparece onde ta rodando o index.js com o nodemon:
[nodemon] 1.10.2
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node index.js
consign v0.1.2 Initialized in /home/milena/projeto/payfast
- ./controllers/pagamentos.js
- ./persistencia/PagamentoDao.js
- ./persistencia/connectionFactory.js Servidor rodando na porta 3000. processando uma requisicao de um novo pagamento Erro ao inserir no banco:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client processando uma requisicao de um novo pagamento Erro ao inserir no banco:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client processando uma requisicao de um novo pagamento Erro ao inserir no banco:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client