import {Router} from 'express'
import fetch from 'node-fetch'
const tasks=Router()
tasks.get('/', async (req,res) => {
const response= fetch('https://dummy-api')
res.json(response)
})
I am getting the error,ERR_TLS_CERT_ALTNAME_INVALID . Adding process.env.NODE_TLS_REJECT_UNAUTHORIZED=1 solved the issue but its not secure to use. Is there any other alternative?