MCPcopy
hub / github.com/lissy93/web-check / resolveHost

Function resolveHost

api/location.js:161–168  ·  view source on GitHub ↗
(hostname)

Source from the content-addressed store, hash-verified

159
160// Resolve hostname to IP so providers requiring a numeric address still work
161const resolveHost = async (hostname) => {
162 try {
163 return (await dns.lookup(hostname)).address;
164 } catch (error) {
165 log.warn(`DNS lookup failed for ${hostname}, falling through with raw host`, error.message);
166 return hostname;
167 }
168};
169
170// Resolve geographic info for a host via a chain of providers with country enrichment
171const locationHandler = async (url) => {

Callers 1

locationHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected