import axios from "axios"; import { env } from "node:process"; const list = axios.get("https://www.peeringdb.com/api/net",{ headers: { "User-Agent": "NET186-AS-SET/1.0.0", "Authorization": `Api-Key ${env.PDB_TOKEN}`, "Content-Type": "application/json" } }); export const getNetName = async (ASN: number): Promise => { const answer = (await list).data; return (answer.data.find((k: any) => k.asn === ASN) ?? { name: `AS${ASN}` }) .name; };