From 9dad304bae5df9ca8f180bb98e3a10f259432c12 Mon Sep 17 00:00:00 2001 From: Tomas Rutkauskas Date: Thu, 12 Nov 2026 14:28:30 +0200 Subject: [PATCH] README: pass a bare host name to ConvertApi.auth The "Alternative domain" example passed 'https://eu-v2.convertapi.com/'. The library builds request URLs as https://${host}/convert/... and https://${host}/upload?..., so that value produced https://https://eu-v2.convertapi.com//convert/..., which looks up a host named "https" and fails with "fetch failed" (ENOTFOUND). The example has been wrong since it was added on 2023-07-04. Use 'eu-v2.convertapi.com', say that the argument is a host name without https:// or a trailing slash, and name the default host. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 156b86b..6fb6917 100644 --- a/README.md +++ b/README.md @@ -89,10 +89,10 @@ let url = result.files[0].Url ### Alternative domain -Set the last argument for the `ConvertApi.auth` method to use an alternative domain. Dedicated to the region [domain list](https://www.convertapi.com/docs/servers-location). +To use a regional server, pass its host name as the second argument of `ConvertApi.auth`, without `https://` or a trailing slash. The default is `v2.convertapi.com`; the regional hosts are listed on the [server locations](https://www.convertapi.com/docs/servers-location) page. ```js -let convertApi = ConvertApi.auth('api-token', 'https://eu-v2.convertapi.com/') +let convertApi = ConvertApi.auth('api-token', 'eu-v2.convertapi.com') ```