mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-04-16 22:15:59 -05:00
API base now in config
This commit is contained in:
parent
11d2a073ea
commit
ffec77b0ad
|
|
@ -6,6 +6,7 @@
|
|||
* browserify is needed for the use of require() in the browser
|
||||
*/
|
||||
const Mii = require('mii-js');
|
||||
const config = require('../../../config.json');
|
||||
const newMiiData = 'AwAAQOlVognnx0GC2qjhdwOzuI0n2QAAAGBzAHQAZQB2AGUAAAAAAAAAAAAAAEBAAAAhAQJoRBgmNEYUgRIXaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAANeC';
|
||||
|
||||
// Prevent the user from reloading or leaving the page
|
||||
|
|
@ -476,7 +477,7 @@ document
|
|||
const tokenType = document.cookie.split('; ').find(row => row.startsWith('token_type=')).split('=')[1];
|
||||
const accessToken = document.cookie.split('; ').find(row => row.startsWith('access_token=')).split('=')[1];
|
||||
|
||||
fetch('https://api.pretendo.cc/v1/user', {
|
||||
fetch(`${config.api_base}/v1/user`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user