// index.ts
import nodeFetch from 'node-fetch'
import https from 'node:https'
// ...
const agent = new https.Agent({
cert: env.tls_cert,
key: env.tls_key,
ca: env.ca_cert,
rejectUnauthorized: false,
})
//..
const req = await nodeFetch(lokiServer, {
agent: agent,
body: JSON.stringify(payload),
method: 'POST',
headers: { 'Content-Type': 'application/json' }
})
// index.ts
import nodeFetch from 'node-fetch'
import https from 'node:https'
// ...
const agent = new https.Agent({
cert: env.tls_cert,
key: env.tls_key,
ca: env.ca_cert,
rejectUnauthorized: false,
})
//..
const req = await nodeFetch(lokiServer, {
agent: agent,
body: JSON.stringify(payload),
method: 'POST',
headers: { 'Content-Type': 'application/json' }
})