Olá,
Estou tentando fazer o teste de HTTPS no Postman mas ele me retorna a mensagem: Could not get response
Segui as instruções do vídeo, criei os arquivos de chave e certificado na pasta api, alterei o arquivo server.js, mais de uma vez, mas não tive sucesso.
O início do meu arquivo server.js está assim:
onst fs = require('fs')
const bodyParser = require('body-parser')
const jsonServer = require('json-server')
const jwt = require('jsonwebtoken')
const https = require('https')
O final está assim:
server.use(router)
https.createServer(
{
key: fs.readFileSync('server.key'),
cert: fs.readFileSync('server.crt')
}, server).listen(8000, () => {
console.log("API disponível em https://localhost:8000")
})
Quando executo npm run start-auth recebo resposta que está rodando.