Fix: Correct IUCN API endpoint URL and address connection issues. Updated API URL to v3 and handled connection errors.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: e931b5ab-041b-42e7-baf1-50017869cef6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/e19c6a51-7e4c-4bb8-a6a6-46dc00f0ec99/53d606c0-59ab-45f3-8ac7-7938548fd7ae.jpg
This commit is contained in:
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
11:28:51 PM [express] serving on port 5000
|
||||||
|
11:29:02 PM [express] GET /api/cites/status 401 in 2ms :: {"success":false,"connected":false,"message…
|
||||||
|
11:29:02 PM [express] GET /api/species 200 in 0ms :: {"success":true,"species":[]}
|
||||||
|
11:29:02 PM [express] GET /api/searches 200 in 1ms :: {"success":true,"searches":[]}
|
||||||
|
IUCN API check failed: getaddrinfo ENOTFOUND apiv4.iucnredlist.org
|
||||||
|
11:29:02 PM [express] GET /api/iucn/status 500 in 93ms :: {"success":false,"connected":false,"message…
|
||||||
|
11:29:03 PM [express] GET /api/cites/status 401 in 1ms :: {"success":false,"connected":false,"message…
|
||||||
|
11:29:03 PM [express] GET /api/species 304 in 1ms :: {"success":true,"species":[]}
|
||||||
|
11:29:03 PM [express] GET /api/searches 200 in 1ms :: {"success":true,"searches":[]}
|
||||||
|
IUCN API check failed: getaddrinfo ENOTFOUND apiv4.iucnredlist.org
|
||||||
|
11:29:03 PM [express] GET /api/iucn/status 500 in 28ms :: {"success":false,"connected":false,"message…
|
||||||
|
11:29:32 PM [express] POST /api/token 200 in 8787ms :: {"success":true,"token":{"id":1,"token":"vypRg…
|
||||||
|
11:29:32 PM [express] GET /api/token 200 in 1ms :: {"token":"vypRgcZfUGD4nCr8jt9Qkwtt","iucnToken":nu…
|
||||||
|
11:29:43 PM [express] GET /api/species/search 200 in 4033ms :: {"success":true,"data":{"pagination":{…
|
||||||
|
IUCN API habitats lookup failed: getaddrinfo ENOTFOUND apiv4.iucnredlist.org
|
||||||
|
11:29:43 PM [express] GET /api/iucn/habitats 500 in 13ms :: {"success":false,"message":"Error from IU…
|
||||||
|
IUCN API threats lookup failed: getaddrinfo ENOTFOUND apiv4.iucnredlist.org
|
||||||
|
11:29:43 PM [express] GET /api/iucn/threats 500 in 8ms :: {"success":false,"message":"Error from IUCN…
|
||||||
|
IUCN API species lookup failed: getaddrinfo ENOTFOUND apiv4.iucnredlist.org
|
||||||
|
11:29:43 PM [express] GET /api/iucn/species 500 in 6ms :: {"success":false,"message":"Error from IUCN…
|
||||||
|
11:29:43 PM [express] GET /api/species/8084 200 in 136ms :: {"success":true,"data":{"cites_listings":…
|
||||||
|
IUCN API conservation measures lookup failed: getaddrinfo ENOTFOUND apiv4.iucnredlist.org
|
||||||
|
11:29:43 PM [express] GET /api/iucn/measures 500 in 6ms :: {"success":false,"message":"Error from IUC…
|
||||||
|
11:29:43 PM [express] GET /api/species/8084 200 in 290ms :: {"success":true,"data":[{"id":19400,"iso_…
|
||||||
|
11:29:44 PM [express] GET /api/species/8084 200 in 309ms :: {"success":true,"data":[{"id":6292,"citat…
|
@ -323,7 +323,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Check if the API is working by hitting the version endpoint
|
// Check if the API is working by hitting the version endpoint
|
||||||
const response = await axios.get("https://apiv4.iucnredlist.org/api/v4/information/api_version", {
|
const response = await axios.get("https://apiv3.iucnredlist.org/api/v3/version", {
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": `Bearer ${iucnToken}`
|
"Authorization": `Bearer ${iucnToken}`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user