API base now in config

This commit is contained in:
Jonathan Barrow
2022-10-01 13:00:05 -04:00
parent 11d2a073ea
commit ffec77b0ad
2 changed files with 5 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ function parseDocs(rawDocs) {
}
function apiGetRequest(path, headers) {
return got.get(`https://api.pretendo.cc${path}`, {
return got.get(`${config.api_base}${path}`, {
responseType: 'json',
throwHttpErrors: false,
https: {
@@ -88,7 +88,7 @@ function apiGetRequest(path, headers) {
}
function apiPostRequest(path, headers, json) {
return got.post(`https://api.pretendo.cc${path}`, {
return got.post(`${config.api_base}${path}`, {
responseType: 'json',
throwHttpErrors: false,
https: {
@@ -100,7 +100,7 @@ function apiPostRequest(path, headers, json) {
}
function apiDeleteRequest(path, headers, json) {
return got.delete(`https://api.pretendo.cc${path}`, {
return got.delete(`${config.api_base}${path}`, {
throwHttpErrors: false,
https: {
rejectUnauthorized: false, // Needed for self-signed certificates on localhost testing